Page 1 of 1
Magick++ strip exif
Posted: 2010-07-23T06:26:05-07:00
by michmix
I want to remove EXIF from JPEG (or another) image in my c++ program (like convert -strip in command line).
For test version I use BMP buffer image, then save as JPEG again. And I have not found another way
Re: Magick++ strip exif
Posted: 2011-07-18T07:04:21-07:00
by mika
Hi!
I'd be interested in that as well, did you manage that?
(i tried using MagickCore::ThumbnailImage but it looks as though i can not manage the proper convert between Magick::Image and MagickCore::Image:
Code: Select all
int main(int argc,char **argv)
{
MagickCore::ExceptionInfo
exception;
MagickCore::Image
*image,
*images,
*resize_image,
*thumbnails;
MagickCore::ImageInfo
*image_info;
thumbnails=MagickCore::NewImageList();
Magick::Image image_m;
try{image_m.read(argv[1]);}catch(...) {return 1;}
images=image_m.image();
while ((image=ShiftImageList(&images)) != (MagickCore::Image *) NULL)
{
resize_image=MagickCore::ThumbnailImage(image,150,150,&exception); // EXECUTION ERROR HERE: magick/resize.c:3271: main: Assertion `exception->signature == 0xabacadabUL' failed.
if (resize_image == (MagickCore::Image *) NULL)
MagickCore::MagickError(exception.severity,exception.reason,exception.description);
(void) MagickCore::PushImageList(&thumbnails,resize_image,&exception);
MagickCore::DestroyImage(image);
MagickCore::DestroyImage(resize_image);
}
(void) strcpy(thumbnails->filename,"image.png");
MagickCore::WriteImage(image_info,thumbnails);
MagickCore::DestroyImageList(thumbnails);
MagickCore::DestroyImageInfo(image_info);
MagickCore::DestroyExceptionInfo(&exception);
MagickCore::DestroyMagick();
return(0);
}
)
Thx!
Mika.
Re: Magick++ strip exif
Posted: 2011-07-19T07:06:00-07:00
by mika
Answering myself:
Code: Select all
MagickCore::StripImage(image_.image());
does that very well. Although it strips all profiles, to strip specifically exif profiles, the profile function should be prefered.