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
 image original position
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

dracola

Argentina
37 Posts

Posted - Jul 19 2012 :  04:02:51  Show Profile  Reply
how to know that image taken from digital camera in position horizontal or vertical?
i tried from imageenview.bitmap.height or width, but it seem all image assum to be horizontal position.
any one can help pliss...
thank's

w2m

USA
1990 Posts

Posted - Jul 19 2012 :  04:55:05  Show Profile  Reply
Try using EnableAdjustOrientation or TIETWainParams.AutoRotate

TIOParams.EnableAdjustOrientation

Declaration

property EnableAdjustOrientation:boolean;


Description

If you set this property to True before load a file which contains EXIF information, the image will be automatically orientated.
This property also sets JPEG_EnableAdjustOrientation and TIFF_EnableAdjustOrientation.


Example
ImageEnView1.IO.Params.EnableAdjustOrientation:=true;
ImageEnView1.IO.LoadFromFile('input.jpg');


or try setting TIETWainParams.AutoRotate := True.


Declaration

property AutoRotate: boolean;


Description

When true this capability depends on intelligent features within the Source to automatically rotate the image to the correct position.


William Miller
Go to Top of Page

dracola

Argentina
37 Posts

Posted - Jul 19 2012 :  05:11:53  Show Profile  Reply
Thanks a lot, I will try it
Go to Top of Page

clementcdip

France
4 Posts

Posted - Sep 12 2013 :  05:46:03  Show Profile  Reply
What did you mean by correct position ?
You will put the picture at is original orientation ?
Go to Top of Page

w2m

USA
1990 Posts

Posted - Sep 12 2013 :  06:17:58  Show Profile  Reply
If your image contains orientation information in the EXIF, the image will be automatically shown in the orientation stored in the EXIF when it is loaded.

William Miller
Go to Top of Page

clementcdip

France
4 Posts

Posted - Sep 12 2013 :  07:04:49  Show Profile  Reply
Because i don't understand something.
In Window i got one picture sized (100 x 300px) with exif orientation.
Extension of the picture is .jpeg
And when i'm executing this part of code:
imageTmp->ParamsFromFile(path);
if(imageTmp->Params->EXIF_Orientation>1)
{
imageTmp->Params->EnableAdjustOrientation = true;
imageTmp->LoadFromFile(path);
}
Image is in 300 x 100px mode.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Sep 12 2013 :  07:29:15  Show Profile  Reply
Perhaps you are using the wrong value for EXIF_Orientation?
I do not really understand what these values mean so I can not help more.

property EXIF_Orientation: integer;

Description
The orientation of the camera relative to the scene, when the image was captured

Value Description
1 top left side
2 top right side
3 bottom right side
4 bottom left side
5 left side top
6 right side top
7 right side bottom
8 left side bottom

A website described it as follows:
http://sylvana.net/jpegcrop/exif_orientation.html

and here:
http://beradrian.wordpress.com/2008/11/14/rotate-exif-images/

You might just try:
mageTmp->Params->EnableAdjustOrientation = true;
imageTmp->LoadFromFile(path);

William Miller
Go to Top of Page

clementcdip

France
4 Posts

Posted - Sep 12 2013 :  07:37:51  Show Profile  Reply
Thanks you very much
Go to Top of Page

w2m

USA
1990 Posts

Posted - Sep 12 2013 :  08:44:31  Show Profile  Reply
I's been a few years since I had working camera, so I had to do some testing with my new Nikon P520.

When I first tried autorotation with imageen, the image did not rotate. By looking at the EXIF parameters I found auto rotate was not enabled by the camera so the EXIF_Orientation parameters were not being saved. After I enabled auto rotate in the camera, the images displayed correctly just by calling:
mageTmp->Params->EnableAdjustOrientation = true;
imageTmp->LoadFromFile(path);

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: