Recent

Author Topic: Lossless Jpeg Functions  (Read 4592 times)

sfeinst

  • Full Member
  • ***
  • Posts: 230
Lossless Jpeg Functions
« on: March 06, 2015, 07:21:11 pm »
I'm looking for the ability to perform lossless jpg functions (like crop and rotation).  Does anyone know of a library that will work with Lazarus/Free Pascal?

Thanks for any information

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: Lossless Jpeg Functions
« Reply #1 on: March 30, 2015, 09:12:43 pm »
FreeImage (http://freeimage.sourceforge.net/): Comes with a Delphi wrapper which could work with fpc as well. Not tested by myself, though...

Excerpt from their manual:
"FreeImage_JPEGTransform()
OperationDescription
FIJPEG_OP_NONENo transformation (nothing is done)
FIJPEG_OP_FLIP_HHorizontal flip
FIJPEG_OP_FLIP_VVertical flip
FIJPEG_OP_TRANSPOSETranspose across upper-left to lower-right axis
FIJPEG_OP_TRANSVERSETranspose across upper-right to lower-left axis
FIJPEG_OP_ROTATE_9090-degree clockwise rotation
FIJPEG_OP_ROTATE_180180-degree rotation
FIJPEG_OP_ROTATE_270270-degree clockwise rotation (or 90-degree ccw)"

sfeinst

  • Full Member
  • ***
  • Posts: 230
Re: Lossless Jpeg Functions
« Reply #2 on: March 30, 2015, 09:28:42 pm »
Thanks, I'll take a look at it.

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: Lossless Jpeg Functions
« Reply #3 on: April 02, 2015, 01:08:50 am »
Imagemagick may also be of use...
http://www.imagemagick.org/Usage/formats/#jpg_lossless

There are fpc bindings, but I've never used them.  Usually just ship the binary with my app and fire off commands with TProcess.
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

sfeinst

  • Full Member
  • ***
  • Posts: 230
Re: Lossless Jpeg Functions
« Reply #4 on: April 02, 2015, 02:23:20 am »
Imagemagick may also be of use...
http://www.imagemagick.org/Usage/formats/#jpg_lossless

There are fpc bindings, but I've never used them.  Usually just ship the binary with my app and fire off commands with TProcess.

I am using ImageMagick that way now (for resizing, not jpeg lossless), but wanted a Pascal way to do it.  I forgot about the bindings.  That may be the better option.

Thanks.

sfeinst

  • Full Member
  • ***
  • Posts: 230
Re: Lossless Jpeg Functions
« Reply #5 on: April 02, 2015, 02:32:28 am »
Actually, just looked.  IM does not do lossless rotations of jpeg directly.  I would have to use the jpegtrans app to do it.  I don't think there are bindings for that, though I will look for bindings for libjpeg which comes with jpegtrans.

 

TinyPortal © 2005-2018