Menu

#31 Make it easer to remove plug-ins

open
nobody
None
5
2012-10-31
2010-08-04
No

FreeImage handles a lot of file formats from very broad fields. Many of these come with fat libs.
When file size is an issue (embedded/mobile) this becomes a problem.

Make it possible to easily exclude some plugs form compiling.
It seams there are some dependencies that make this unnecessary involved:
https://sourceforge.net/projects/freeimage/forums/forum/36110/topic/3491982

Also the way do remove plugs must be documented. Even if it is the current way (with depend. solved hopefully)

Discussion

  • Mihail Naydenov

    Mihail Naydenov - 2010-08-19

    Testcase (test images not included)

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-08-19

    Attached a patch witch make it easer to remove plugins.

    To remove a Plugin:
    1. Comment the relevant addNode() in Plugin.cpp FreeImage_Initialize
    2. Remove the plugin code (and its lib)

    These can be made to be #defined controlled, but I dont think the mess is worth it.

    What the plug does is force using the FREE_IMAGE_FORMAT enum values for the Plugin lookup, without assuming both value and position (in the enum) match, as it was before.

    This means that if you remove (comment out) a plug, and what to iterate over all fif-s, use the new FreeImage_GetLastFIF() instead of FreeImage_GetFIFCount():

    for(int i=0; i < FreeImage_GetLastFIF(); ++i)
    {
    FREE_IMAGE_FORMAT fif = (FREE_IMAGE_FORMAT) i;
    ...
    }

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-11-17

    Patch (3.14.1) fixed load and save

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-11-17

    I missed changing in Plugin.cpp
    line 401 and 473 the load and save routines.

    They used FreeImage_GetFIFCount with is incorrect - fif can be any number and should be checked against FreeImage_GetLastFIF

    attached a new patch

     
  • Mihail Naydenov

    Mihail Naydenov - 2010-12-02

    Patch (3.15 CVS 2-11-2010)

     

Anonymous
Anonymous

Add attachments
Cancel