Disable FFmpeg and non-image related features at run time

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
deck
Posts: 2
Joined: 2014-01-07T12:53:01-07:00
Authentication code: 6789

Disable FFmpeg and non-image related features at run time

Post by deck »

I am developing a program that aim to identify images, and only images. But when I use Magick::Image on a video, the library won't return after loading the entire file (using ffmpeg). I just want to get the general informations on the image (size, format, colorspace, compression...), and it should be quick. In the case of a non-image file, I don't even want anything, an error is fine. So is there a way to select the features of the library that I want to use, and disable those that don't interest me, at run time ? Like FFmpeg, and maybe other video/non-image related features ?

I'm just starting to use ImageMagick, so maybe the Image class, or even Magick++ is not the easiest way to go if I just want to get general informations on an image ?

Thank you.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Disable FFmpeg and non-image related features at run tim

Post by dlemstra »

You will have to disable the coders that you don't want to use. With coderInfoList in STL.h you will be able to get a list of all available coders. You could iterate through the coders and call MagickCore::UnregisterMagickInfo(CoderInfo->name) for the coders you don't want to be available.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
deck
Posts: 2
Joined: 2014-01-07T12:53:01-07:00
Authentication code: 6789

Re: Disable FFmpeg and non-image related features at run tim

Post by deck »

That sounds promising, thank you.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Disable FFmpeg and non-image related features at run tim

Post by dlemstra »

I will add an unregister method to CoderInfo to make this easier.

EDIT: The unregister method has been added and will be available in ImageMagick 6.8.8-2.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply