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
 Wrong image width and height in pixel

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
mastinf Posted - Mar 04 2025 : 11:27:03
Hello, i have this old code that read the height e width of an image in pixel.
I have recently upgraded to the latest version of ImageEn an now the function returns the wrong image size: width and height are swapped. I have attached an image. Thanks.

var
  img:Timageenview;
  ff: TIOFileType;
begin
  if not(fileexists(percorso_immagine)) then exit;

  img:=Timageenview.create(nil);
  try
    ff := FindFileFormat( percorso_immagine, false );
    img.IO.ParamsFromFile( percorso_immagine, ff );

    puntix:=img.io.params.width;
    puntiy:=img.io.params.height;
  finally
    img.free;
  end;
end;


attach/mastinf/202534112337_AU-ART1.JPG

Roberto Nicchi
Master Informatica
Italy
7   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Mar 13 2025 : 16:12:12
Hi Roberto

Not at present, but you can just swap the values as follows:

    if Params.EXIF_Orientation in [ _exoNeeds90RotateCW, _exoNeeds270RotateCW ] then
      Swap( Width, Height );


Or email me for the latest beta, which supports it with:

https://www.imageen.com/help/GetImageDetails.html

Nigel
Xequte Software
www.imageen.com
mastinf Posted - Mar 13 2025 : 06:29:03
Does exists a function that calculate the width and height depending on EXIF_ORIENTATION ?

Thanks.

Roberto Nicchi
Master Informatica
Italy
xequte Posted - Mar 06 2025 : 16:13:28
Hi Roberto

Sorry, I confused matters with my comment. EnableAdjustOrientation only affects the display of the image on load, so ImageEnView1.IEBitmap.Width/Height are affected by EnableAdjustOrientation, but not ImageEnView1.IO.Params.Width/Height (which show the true values).


Nigel
Xequte Software
www.imageen.com
mastinf Posted - Mar 06 2025 : 02:45:32
Could be normal that EnableAdjustOrientation doesn't affects io.params.width and height.
If it's correct does exists a function to calculate the correct width and height of the image depending on EXIF_ORIENTATION ? Or have to write my own ? Thanks.

Roberto Nicchi
Master Informatica
Italy
mastinf Posted - Mar 06 2025 : 02:11:06
Hello, EnableAdjustOrientation seems to have no effect. Setting true or false doesn't change the width and height.

img.IO.Params.EnableAdjustOrientation:=true/false
img.IO.ParamsFromFile( ... );

puntix:=img.io.params.width; <---- doesn't change
puntiy:=img.io.params.height; <---- doesn't change

Roberto Nicchi
Master Informatica
Italy
xequte Posted - Mar 05 2025 : 21:23:08
Hi Roberto

Yes, that's right. Also, you can control the automatic rotation using:

http://www.imageen.com/help/TIOParams.EnableAdjustOrientation.html

Nigel
Xequte Software
www.imageen.com
mastinf Posted - Mar 05 2025 : 02:45:32
Ok, i got it. It's related to the io.params.exif_orientation. The image is rotate 90°

Roberto Nicchi
Master Informatica
Italy