DBPix Documentation
Version 2.0

JPEGRotateWarning Property


Description:  Determines the action taken when attempting Lossless JPEG Rotation of an image with partially complete JPEG blocks.
Type:  Number (enum/short)
Read/Get
Write/Set:
  
 
 
Remarks:  

ConstantValueDescription
JPEGRotWarningPrompt0Prompts the user to choose the action to take (default).
JPEGRotWarningTrim1Performs a lossless rotate, trimming the image by a few pixels to the nearest JPEG block.
JPEGRotWarningLossy2Performs a 'lossy' rotate, i.e. rotates the full image then re-encodes the image as a new jpeg.
JPEGRotWarningIgnore3Ignore the warning and performs a lossless rotate. Incomplete jpeg blocks along one or two sides of the image will be left unrotated.
JPEGRotWarningAbort4Abort the operation and do not rotate the image.


Rotating an image typically involves decoding, rotating the decoded bitmap, then re-encoding (or re-compressing) in the relevant image format. Since jpeg encoding is 'lossy' (i.e. degrades the image) this re-encoding is undesirable. Lossless JPEG rotation avoids the lossy re-compression step, but it can only rotate complete 'JPEG Blocks' (jpeg blocks are typically 8x8 or 16x16 pixels).

If the width and height of a JPEG image are multiples of the block size (as is the case for images from most digital cameras), then the image will always be rotated losslessly, If the image does not meet these conditions then the value of this property determines the course of action. The developer can choose either to prompt the user, or to automatically use any of the available options.

Note that if you use DBPix to resample images as they are loaded, we strongly recommend choosing target dimensions that will result in the width and height being multiples of 8, for both portrait and landscape images.

 

 

Documentation version 2.0.0