How to get DPI from PSD file

I have multiple PSD files I am converting the file to jpg using http://imageresizing.net/ library

How can I get DPI information from a PSD file using C #?

Update I wrote the following code, however the problem with this is it opens Photoshop in the background

ps.Application a = new ps.Application() { Visible = false };
a.Load(filePath);
ps.Document doc = a.ActiveDocument;
dpi = doc.Resolution;
a.ActiveDocument.Close();
a.Quit();

      

+3


source to share


1 answer


These are the first settings I use when opening PS programmatically:



                // Open PhotoShop
                app = new ps.Application();
                app.Preferences.RulerUnits = ps.PsUnits.psPixels;
                app.DisplayDialogs = ps.PsDialogModes.psDisplayNoDialogs;
                app.Visible = false;

      

+1


source







All Articles