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
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.
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.
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.
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
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);