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
 Lossless rotation crops image
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

benjykid

5 Posts

Posted - Jan 02 2014 :  04:30:59  Show Profile  Reply
I have a JPG image with the dimensions 1765 x 2209. Then I'm using the lossless rotation on it. This rotates the image, but it also crops it to 1760 x 2208 (after rotating two times).

JpegLosslessTransformStream(Src, Dest, jtRotate90, False, jcCopyAll, Rect(0,0,0,0), True);

How can I prevent this from happening?

xequte

39056 Posts

Posted - Jan 02 2014 :  19:58:40  Show Profile  Reply
Hi

You can't. JPEG lossless rotation works by rotating each of the "blocks" within an image. Along two edges of an image there will almost always be rows of irregular sized blocks that cannot be rotated, so they are cropped off.

This is the standard way all applications perform lossless rotation.

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

benjykid

5 Posts

Posted - Jan 03 2014 :  00:12:07  Show Profile  Reply
Hm.... I've now researched this and you seem to be right. But there is the possibility to preserve these partial blocks, but then they will be have to be shown in full. Is this something you might be able to add as an option?

Then I'd only have to save the dimensions of the padding at the top or left. But that does not appear to be in the JPG standard :-(
Go to Top of Page

xequte

39056 Posts

Posted - Jan 03 2014 :  02:23:10  Show Profile  Reply
Hi

We do not provide the option of maintaining the partial blocks. In practice there are very few pixels that are lost, so there is little value in keeping them in their unrotated state or padded.



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