Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-06

JPEG scaling

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

theo

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

Reply by email

Michael Van Canneyt
to theo
theo wrote 18 lines
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?

I don't expect any; But I would appreciate it if you could make a bug report and attache the patch to it. You can assign it to me, this way i won't forget to apply the patch.

Michael.

Reply by email