GNOME Bugzilla – Bug 144943
Include the RAW_Load Plugin
Last modified: 2008-01-15 12:43:13 UTC
The RAW Loading Plugin is extremly helpful for extracting images from archive files, and analysing binary content. I ported it to GIMP2 now, since it does not seem to be maintained anymore. I would like it to be included in GIMP, since I use it very often, and I think that it is useful for others too.
Created attachment 28992 [details] RAW_Load 3.1 (Gimp2 version)
Created attachment 29066 [details] raw.c extracted from the tarball for easier review
I wouldn't object to include this plug-in but the code you attached is far from being clean enough to be included in the GIMP source tree. The port to GTK+-2.0 and GIMP-2.0 is only halfway done and the GUI as well as the overall coding style needs a serious cleanup.
Created attachment 30842 [details] Improved version Ok, I improved it, it compiles and works cleanly now. If you want any more improvements, cleanups, ... please tell me exactly what and how, or perhaps do it yourself.
Created attachment 30843 [details] raw.c extracted
I cannot speak for Sven, but there are a few things that you could improve easily in this code (compare with other GIMP source files if you want a reference): - Avoid C++ style comments (//) because they cause problems with some C compilers so use only C-style comments (/*...*/) only. - Try to use gimp_frame_new() instead of gtk_frame_new(). You should also check the gimp convenience function for tables. - Try to use the GNU style for indentation (e.g., opening and closing braces on their own line, 2 spaces per indentation level, etc.). This is explained in the file HACKING in the GIMP source tree. See the section "Hackordnung". - You should probably add your name to the copyright in gimp_install_procedure().
Created attachment 30859 [details] raw.c from Version 3.3 I normally prefer // comments, because they do not have reentrace problems. gimp_frame_new() is only available in Gimp2.2, and I would suggest to be Gimp2.0 compatible. I changed the indentation now, and added my email address. Anything else?
This is not about preferences. // comments are not supported by the compilers that GIMP is supposed to compile on so there is no way we can accept code that uses these comments. Also there is no way the raw plug-in can be accepted into the stable branch and if you want it to be accepted for 2.2 it will have to use the 2.2 API and adhere to the look and feel of GIMP 2.2 plug-ins.
If you want the raw plug-in to be available for users of GIMP 2.0, then your best solution is to make your new version available through http://registry.gimp.org/. If you want it to be included in the GIMP source tree so that it is distributed together with the next releases, then you have to use the GIMP 2.2 API. This means that you have to use gimp_frame_new() and other functions, as I recommended above. Minor detail: although you made a few changes to the indentation of your code, it still doesn't match the style used in all other GIMP source files. Please read the HACKING file carefully if you want to fix this (otherwise someone else will have to do it anyway, so it is better if you do it yourself).
Created attachment 31013 [details] raw.c V3.4 Ok, I applied the Hackordnung, removed the // comments, posted the Gimp2.0 version to the registry, and here is the proposed Gimp2.2 version.
I guess we should at least consider it for inclusion then. Thanks for your efforts.
I had a look at it and this code will need quite some changes before it can be accepted for inclusion. It is still pretty much a GIMP 1.2 plug-in, using deprecated GTK+ 1.2 and GIMP 1.2 APIs (like for example gimp_radio_group_new2() and GtkPreview). It doesn't follow the GIMP coding style and I will also not accept stupid rants from timecop in our source tree.
Created attachment 31055 [details] raw.c V3.5 Ok, I removed the rant. Do you have a HOWTO-Convert-GTK1.2-and-Gimp1.2-to-GTK2-and-Gimp2 ? Otherwise I am at the end of my knowledge. Perhaps someone else can do the rest of the necessary improvements.
Here are some TODOs for the plug-in: - Replace gimp_radio_group_new2() with gimp_int_radio_group_new(). Integers are being used here and the current code won't work on 64bit platforms. - Replace GtkPreview with GimpPreview. - Replace GtkFileSelection with GtkFileChooser. - Port the signal code to GObject. - Remove all warnings that show up when GLIB_DISABLE_DEPRECATED, GDK_DISABLE_DEPRECATED GTK_DISABLE_DEPRECATED and GIMP_DISABLE_DEPRECATED are being defined.
Since i missed this plug-in several times and want it to be included, I'll do the porting.
Fixed in CVS: 2004-10-20 Michael Natterer <mitch@gimp.org> * plug-ins/common/raw.c: new plug-in from Tim Copperfield, made work with the GIMP 2.1 API by Philipp Gühring, then heavily cleaned up and undeprecated by myself. Fixes bug #144943. (still uses GtkPreview, but i wanted a sane state in cvs to diff against before replacing it) * plug-ins/common/plugin-defs.pl: changed accordingly. * plug-ins/common/Makefile.am: regenerated.
Wasn´t it included in Gimp 2.1 ? I can´t find it anymore in 2.2.4. I can´t even find it in the dead files in CVS. Did it break between 2.1 and 2.2, and was removed then?
Sorry, I didn´t saw it, because the file-formats are seperated from the file-extensions now.
Well, it isn't really available in GIMP 2.2 due to a bug in the plug-in procedure registry (see bug #309361).