Re: [GM-help] how to crop an image and repage using magic_wand c api?
Swiss army knife of image processing
Brought to you by:
bfriesen
From: Ben Wu <wu...@gm...> - 2012-10-26 04:34:34
|
Thank you Bob! I have attached a standalone command line program as well as the input image and output image. To run it you just do crop-gm mar528_200_resized.gif mar528_crop75.gif 75 75 50 0 1 Ben On Thu, Oct 25, 2012 at 11:08 PM, Bob Friesenhahn <bfr...@si...> wrote: > On Thu, 25 Oct 2012, Ben Wu wrote: > >> Thank you Bob. I tried the new functions but I am not getting the >> right results or maybe I am not calling it correctly. The output image >> is attached. My code snippet is below: > > > I see that bad page offset in your GIF. > > >> >> MagickWand *sc; >> MagickWand* dst; >> // ....more code .... >> dst = MagickCoalesceImages(src); >> MagickResetIterator(dst); >> while(MagickNextImage(dst) != MagickFalse) >> { >> MagickCropImage(dst, 75, 75, 39, 0); >> MagickSetImagePage(dst, 0, 0, 0, 0); >> } >> >> MagickResetIterator(dst); >> out = MagickWriteImageBlob(dst, &image_blob_length); >> .... >> >> >> I can crop jpeg fines. In fact to crop jpegs, i dont even need to call >> the MagickResetImagePage function. > > > That is because JPEG does not store page offsets. > > I am not seeing a problem in the code. > > Can you please send a tiny stand alone source file which recreates the > problem so that we can be sure of using the same code and that a strange > side-effect is not coming from other code? > > > Bob > -- > Bob Friesenhahn > bfr...@si..., http://www.simplesystems.org/users/bfriesen/ > GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ |