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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Auto rotate photos when loading
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
725 Posts

Posted - Aug 18 2015 :  03:00:31  Show Profile  Reply
I have observed that when we load photos in ImageEnMView it automatically rotates all photos that are shot using tilted camera.

So any photo snapped by rotating the camera at say for example 90 degree is automatically rotated to show it properly.

My question is when we load a photo of such nature using following code in a layer:
ieTemp := TImageEnView.Create(Application);
    ieTemp.LayersAdd;
    ieTemp.IO.LoadFromFile(fn);

    // +++++++++++++++++++++++++++++++++++++
    if ieTemp.Layers[ieTemp.LayersCurrent].Width < LW then
    begin
      if LW > LH then
        ieTemp.Proc.Resample(LW, -1, TResampleFilter(4))
      else
        ieTemp.Proc.Resample(-1, LH, TResampleFilter(4));
      ieTemp.Proc.Sharpen(8);
    end
    else
    begin
      if LW > LH then
        ieTemp.Proc.Resample(LW, -1, TResampleFilter(0))
      else
        ieTemp.Proc.Resample(-1, LH, TResampleFilter(0));
    end;

    // ieTemp.Proc.Sharpen(5);
    // +++++++++++++++++++++++++++++++++++++

    Child.ImageEnView1.Layers[i].Assign(ieTemp.CurrentLayer);
    ieTemp.Free;


It does not auto rotate. How to get ImageEn to auto rotate the photo when opening it?

TIA



Yogi Yang

xequte

38209 Posts

Posted - Aug 18 2015 :  05:29:27  Show Profile  Reply
Hi

You need to enable JPEG_EnableAdjustOrientation, e.g.

ImageEnView1.IO.Params.JPEG_EnableAdjustOrientation := True;
ImageEnView1.IO.LoadFromFile('C:\input.jpg');


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

ali

Iran
110 Posts

Posted - Sep 29 2020 :  10:18:56  Show Profile  Reply
Hi Nigel

Can I auto rotate TImage which ImageEnIO1 attached by TImage?
You can see in the attachment image.


Best Regards

Ali Abbasi

Go to Top of Page

xequte

38209 Posts

Posted - Sep 30 2020 :  03:06:34  Show Profile  Reply
Yes, the same code above should do it (even with TImage). This assumes the image contains EXIF data showing the correct orientation.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

ali

Iran
110 Posts

Posted - Sep 30 2020 :  12:20:01  Show Profile  Reply
Hi Nigel

I tested ImageEnIO.IO.Params. and after typed dot it do not show 'JPEG_EnableAdjustOrientation'.
Do I add most to uses section for this issue?

Best Regards

Ali Abbasi
Go to Top of Page

xequte

38209 Posts

Posted - Sep 30 2020 :  16:10:31  Show Profile  Reply
The iexBitmaps unit is required. You should add that if it wasn't added automatically:

https://www.imageen.com/help/TIOParams.JPEG_EnableAdjustOrientation.html


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

ali

Iran
110 Posts

Posted - Oct 02 2020 :  10:58:18  Show Profile  Reply
Hi Nigel

Thank you for your attention, I test it code and it do not working with personal photo which scanned from scanner.
If you download above photo then you can check it which above code do not working with it.
Maybe it working photo from cameras.

Do you have solution for check user select photo from top left to buttom right or buttom right to top left?

Best Regards

Ali Abbasi
Go to Top of Page

xequte

38209 Posts

Posted - Oct 02 2020 :  21:03:08  Show Profile  Reply
Hi Ali

Auto-rotation only works for photos that have been taken by a camera that supports it (the camera sets an orientation field in the EXIF meta-data which ImageEn uses). It does not work with images from scanners.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

skippix

USA
68 Posts

Posted - Dec 12 2020 :  06:30:47  Show Profile  Reply
I can't get my ImageEnMView grid to auto-rotate RAW files. It works fine with jpgs.

I've included iexBitmaps in the unit and on form create, I set the properties for my grid and single image viewer:

imgMView.EnableAdjustOrientation := True;
imgViewer.IO.Params.EnableAdjustOrientation := True;

My imgViewer works as expected, but the imgMView leaves everything horizontal.
Using the iexMetaHelpers to view the image properties, it shows
Camera Orientation = Offset by 90° Clockwise

Any ideas?

Thanks!
Skip
Go to Top of Page

xequte

38209 Posts

Posted - Dec 13 2020 :  20:41:26  Show Profile  Reply
Hi Skip

What is the value of IEGlobalSettings().ActiveCameraRawEngine?

https://www.imageen.com/help/TIEImageEnGlobalSettings.ActiveCameraRawEngine.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

skippix

USA
68 Posts

Posted - Dec 14 2020 :  05:36:37  Show Profile  Reply
Thanks, Nigel!

I looked at that link and found a slight discrepancy between that documentation and my source code.

Your link's type def:
TIEImagingEngine = (ieenAuto, ieenNative, ieenDLL, ieenWIC, ieenLegacy);

My source type def:
TIECameraRawEngine = (iecrAuto, iecrLibRaw, iecrWIC, iecrDCRaw);

My source build:
ImageEn Build 9.0.0.00.3466 @ 10-Apr-20 19:10:45.918

To answer your question,

IEGlobalSettings().ActiveCameraRawEngine = iecrLibRaw

Thanks,
Skip
Go to Top of Page

xequte

38209 Posts

Posted - Dec 15 2020 :  18:11:41  Show Profile  Reply
Thanks for the report, Skip,

You can email me for a fix.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: