Code: Select all
var
vLoadParam: GFL_LOAD_PARAMS;
vSaveParam: GFL_SAVE_PARAMS;
pBmp: PGFL_BITMAP;
begin
gflGetDefaultLoadParams( vLoadParam );
gflGetDefaultSaveParams( vSaveParam );
vSaveParam.FormatIndex:= gflGetFormatIndexByName( PChar( 'jpeg' ) );
vSaveParam.OptimizeHuffmanTable:= GFL_TRUE;
vSaveParam.Quality:= 100;
gflLoadBitmapW( PWideChar( Widestring( '1.jpg' ) ), @pBmp, @vLoadParam, nil );
gflSaveBitmapW( PWideChar( Widestring( '2.jpg' ) ), pBmp, @vSaveParam );
// Picture had and has a width/height of 3000x2008
gflJpegLosslessTransform( PChar( '2.jpg' ), GFL_LOSSLESS_TRANSFORM_ROTATE90 );
// Width/height are now 2000x3000 - this means 8 pixel rows are missing
gflJpegLosslessTransform( PChar( '2.jpg' ), GFL_LOSSLESS_TRANSFORM_ROTATE90 );
// Problem continues: width/height are now 2992x2000 - another 8 pixel rows are missing
gflJpegLosslessTransform( PChar( '2.jpg' ), GFL_LOSSLESS_TRANSFORM_ROTATE90 );
// Problem stopped: Width/height are now 2000x2992 - interestingly enough, now nothing has been cropped
Also: please add a Unicode version of that function, i.e. gflJpegLosslessTransformW(). Thanks