ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Problems understanding IO.Params.DPI

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
uko Posted - May 09 2017 : 09:12:57
Hi

I have some troubles understanding the results of IO.Params.DPI: depending on the way I read this params I get different results for the same image (ImageEN version 6.3.2 using Delphi XE).

Please take this picture:


I used this test code to read the DPI
ImageEnView1.IO.LoadFromFileAuto('d:\downloads\elefant.jpg');

  lIO := TImageEnIO.Create(nil);
  try
    lIO.LoadFromFileAuto('d:\downloads\elefant.jpg');
    nDPI_lIO := lIO.Params.Dpi;
  finally
    lIO.Free;
  end;

  lIO := TImageEnIO.Create(nil);
  try
    lIO.ParamsFromFile('d:\downloads\elefant.jpg');
    nDPI_lIO_pre := lIO.Params.Dpi;
  finally
    lIO.Free;
  end;

  ShowMessage(Format('lIO.Params.Dpi: %d' + #10#13 + 'lIO.Params.Dpi (ParamsfromFile): %d' + #10#13 + 'ImageEnView1.IO.Params.Dpi: %d',[nDPI_lIO, nDPI_lIO_pre, ImageEnView1.IO.Params.Dpi]));


The results are 300, 1 and 300. So why I get a different result when using ParamsFromFile? And what does this values mean in the current situation? I checked the image with IrfanView and it looks like there is no resolution assigned.
So how can I determine if there is a resolution assigned?


Thank you,
Uli
4   L A T E S T    R E P L I E S    (Newest First)
uko Posted - May 16 2017 : 02:38:43
Thanks Nigel.

I have done this now and everything is working fine.


best regards,
Uli
xequte Posted - May 16 2017 : 02:04:39
Hi Uli

You can just check the DPI yourself after loading and set it correctly, if needed.

The default DPI settings are here:

https://www.imageen.com/help/TIEImageEnGlobalSettings.DefaultDPIX.html
https://www.imageen.com/help/TIEImageEnGlobalSettings.DefaultDPIY.html

e.g.

// Set the default DPI to 72 points per inch
IEGlobalSettings().DefaultDPIX:= 72;
IEGlobalSettings().DefaultDPIY:= 72;


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
uko Posted - May 15 2017 : 08:12:49
Hi Nigel,

please excuse the long delay in answering. And thank you for explaining the problem. My solution is now, to adjust the default DPI to 72DPI (which fit's much better for me) and always do a check like TImageEnIO.CheckDPI when loading the params independent from image. One wish: can you make TImageEnIO.CheckDPI a public method?

Thank's Uli
xequte Posted - May 09 2017 : 23:15:42
Hi Uli

This image has an invalid DPI specified (1), so when it is loaded as an image, ImageEn corrects it with the default DPI (specified in iesettings).

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com