[fpc-devel] JPEG scaling

theo xpde at theo.ch
Thu Jun 17 19:50:02 CEST 2010


Hello,

Is there a technical reason why in packages/fcl-image/src/fpreadjpeg.pas 
the scale option is commented / not implemented?

I've changed that unit for my purpose (see attachment. I hope the patch 
is valid, I don't have a svn fpc, so it's hand edited).

I have to create thumbnail images and found, that pre-scaling via 
fpreadjpeg.pas makes loading the images a lot faster.
Of course resampling to the final size is faster too.

The idea of the attached code is, to set MinWidth/MinHeight to the size 
of the desired thumbnail.
The image is pre-shrunk this way (still always bigger than thumbnail) 
and can be resampled afterwards via stretch draw.

Any problems to expect?

Thank you
Best regards
Theo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fpreadjpeg.diff
Type: text/x-patch
Size: 1795 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20100617/f9bf8351/attachment.bin>


More information about the fpc-devel mailing list