QPx_TranscodeJPEGFile
QPx_TranscodeJPEGFile(inputFilePath; inputFilePath; inputFilePath; inputFilePath; inputFilePath):error | |||
---|---|---|---|
![]() |
inputFilePath | Text | Input JPEG file |
![]() |
outputFilePath | Text | Output JPEG file |
![]() |
transformationType | Longint | Geometric transformation |
![]() |
mcuHandling | Longint | MCU handling |
![]() |
markerHandling | Longint | Handling of non-image data |
![]() |
error | Longint | Error result |
Transcode a JPEG file
The input JPEG file is specified by inputFilePath. If the file does not exist or if it is not a valid JPEG file, an appropriate error code is returned.
Parameter outputFilePath specifies where to write the transcoded JPEG. If a file already exists at that location it is overwritten by the output file.
Parameter transformationType specifies the geometric transformation to perform on the image data. Transformations are defined by the following constants:
qpx_JPEGTransformNone | 0 | Do not transform |
qpx_JPEGFlipHorz | 1 | Flip horizontally |
qpx_JPEGFlipVert | 2 | Flip vertically |
qpx_JPEGMirrorAcrossUL2LRAxis | 3 | Mirror across upper-left to lower-right axis |
qpx_JPEGMirrorAcrossUR2LLAxis | 4 | Mirror across upper-right to lower-left axis |
qpx_JPEGRotate90 | 5 | Rotate 90 |
qpx_JPEGRotate180 | 6 | Rotate 180 |
qpx_JPEGRotate270 | 7 | Rotate 270 |
All transformations except qpx_JPEGMirrorAcrossUL2LRAxis may be affected if the image dimensions are not a multiple of the MCU size (8 pixels for grayscale, 16 pixels for color images). Because only complete blocks of data can be transformed, some transformations may leave untransformed blocks at the edges.
The following table summarizes the effects of non-MCU-multiple image dimensions for each available transformation. A ★ indicates that the specific transformation will cause "edge effects".
Transformation | (width % MCU) # 0 | (height % MCU) # 0 |
---|---|---|
qpx_JPEGRotate90 | ★ | |
qpx_JPEGRotate180 | ★ | ★ |
qpx_JPEGRotate270 | ★ | |
qpx_JPEGFlipHorz | ★ | |
qpx_JPEGFlipVert | ★ | |
qpx_JPEGMirrorAcrossUL2LRAxis | ||
qpx_JPEGMirrorAcrossUR2LLAxis | ★ | ★ |
Parameter mcuHandling specifies how to handle this issue. Available options are:
qpx_JPEGIgnorePartialMCUs | 0 | Ignore untransformed blocks at the edges |
qpx_JPEGTrimPartialMCUs | 1 | Trim images with odd dimensions |
qpx_JPEGProhibitPartialMCUs | 2 | Transform only even-size images |
Parameter markerHandling specifies how to treat the non-image data of the input JPEG. It can be one of the following constants:
qpx_JPEGCopyAllMarkers | 0 | Copy all non-image data |
qpx_JPEGCopyCommentsOnly | 1 | Copy comments only |
qpx_JPEGCopyNoMarkers | 2 | Do not copy non-image data |
Related commands
QPx_TranscodeJPEGBLOB | Transcode a JPEG BLOB |