GNOME Bugzilla – Bug 758760
OpenRaster plug-In could not open image
Last modified: 2016-01-08 10:15:42 UTC
OpenRaster plug-In could not open image That's what it says when I try to open one. I can export ora files but I can't open them.
Created attachment 316678 [details] Gimp error text I use Ubuntu 12.04 LTS and Gimp recently updated. Before, I had a plugin that could open .ora files, but since it's updated I keep getting this error message.
This happens only in gimp-2.8. If you open an .ora file GIMP exported, you get: Traceback (most recent call last):
+ Trace 235783
res = apply(func, params[1:])
if not name:
it seems that this conflicting cherry-picked commit: https://git.gnome.org/browse/gimp/commit/plug-ins/pygimp/plug-ins/file-openraster.py?h=gimp-2-8&id=621f5e296def8159020201b06f544517624f767d missed an if block removal (if block that is now part of another else branch), if you run (adjust paths to source tree): git diff -- gimp{-2-8,}/plug-ins/pygimp/plug-ins/file-openraster.py it outputs: diff --git a/../gimp-2-8/plug-ins/pygimp/plug-ins/file-openraster.py b/../gimp/plug-ins/pygimp/plug-ins/file-openraster.py index 6aa273c..c6b2949 100755 --- a/../gimp-2-8/plug-ins/pygimp/plug-ins/file-openraster.py +++ b/../gimp/plug-ins/pygimp/plug-ins/file-openraster.py @@ -26,7 +26,7 @@ layermodes_map = { "svg:src-over": NORMAL_MODE, "svg:multiply": MULTIPLY_MODE, "svg:screen": SCREEN_MODE, - "svg:overlay": OVERLAY_MODE, + "svg:overlay": NEW_OVERLAY_MODE, "svg:darken": DARKEN_ONLY_MODE, "svg:lighten": LIGHTEN_ONLY_MODE, "svg:color-dodge": DODGE_MODE, @@ -271,11 +271,6 @@ def load_ora(filename, raw_filename): parent_groups.pop() continue - if not name: - # use the filename without extention as name - n = os.path.basename(path) - name = os.path.splitext(n)[0] - if item.tag == 'stack': name, x, y, opac, visible, layer_mode = get_group_layer_attributes(item) gimp_layer = gimp.GroupLayer(img) removing it also in gimp-2.8 fixes the issue.
(In reply to Massimo from comment #2) > This happens only in gimp-2.8. If you open an .ora file GIMP > exported, you get: > > Traceback (most recent call last): So, is this something I can fix myself then? I don't have any experience when it comes to these things so I don't even know where I can find what you're talking about.
(In reply to ghostlights from comment #3) > (In reply to Massimo from comment #2) > > This happens only in gimp-2.8. If you open an .ora file GIMP > > exported, you get: > > > > Traceback (most recent call last): > > So, is this something I can fix myself then? I don't have any experience > when it comes to these things so I don't even know where I can find what > you're talking about. Theoretically you could fix it yourself if you have urgent need to edit OpenRaster files. You have to find the file 'file-openraster.py' which should be in the directory /usr/lib/gimp/2.0/plug-ins/ The prefix /usr could be /usr/local or /opt or something else and lib could be lib64, anyway in that file you'll have to delete lines 274, 275, 276 and 277 that are: if not name: # use the filename without extention as name n = os.path.basename(path) name = os.path.splitext(n)[0] beware few lines below this text is repeated but that's correct. But probably it is better if you wait until the next stable release, assuming there will be one.
Created attachment 318208 [details] [review] proposed patch It seems the branch gimp-2-8 is still updated so if there are no objections I'll push the attached patch
A patch sounds good to me! I couldn't manage to change the file myself with what you suggested earlier.
Fixed in master: commit d4cebcea8fec7c74b65bd94332d5ac8ce4c303c7 Author: Massimo Valentini <mvalentini@src.gnome.org> Date: Thu Jan 7 17:49:52 2016 +0100 Bug 758760: OpenRaster plug-In could not open image An oversight while cherry-picking in 621f5e296def8159020201b06f544517624f767d
(In reply to Massimo from comment #7) > Fixed in master: > > commit d4cebcea8fec7c74b65bd94332d5ac8ce4c303c7 > Author: Massimo Valentini <mvalentini@src.gnome.org> > Date: Thu Jan 7 17:49:52 2016 +0100 > > Bug 758760: OpenRaster plug-In could not open image > > An oversight while cherry-picking in > > 621f5e296def8159020201b06f544517624f767d So, how can I apply the patch to gimp then? I've never done that before.
(In reply to ghostlights from comment #8) > (In reply to Massimo from comment #7) > > Fixed in master: > > > > commit d4cebcea8fec7c74b65bd94332d5ac8ce4c303c7 > > Author: Massimo Valentini <mvalentini@src.gnome.org> > > Date: Thu Jan 7 17:49:52 2016 +0100 > > > > Bug 758760: OpenRaster plug-In could not open image > > > > An oversight while cherry-picking in > > > > 621f5e296def8159020201b06f544517624f767d > > So, how can I apply the patch to gimp then? I've never done that before. It is no longer necessary to apply the patch as it is now fixed in git and will be in the next stable release. The patch attached to comment 5 is a patch for GIMP sources, after applying it, it is necessary to install GIMP to be effective. To fix an installed GIMP it is easier to find the file file-openraster.py and delete lines 274, 275, 276 and 277.
We probably have different definitions of "patch" here - to some people, especially on the windows platforms, this means an executable file that can be run to apply the changes (I am *not* referring to the patch command). Grabbing the current version of the plug-in is an option, though - as it is written in Python, you can just replace the .py file in GIMP's plug-ins directory (that is, lib\gimp\2.0\plug-ins\ ) by this one: https://git.gnome.org/browse/gimp/plain/plug-ins/pygimp/plug-ins/file-openraster.py?h=gimp-2-8