It is currently Sat Jun 15, 2024 3:37 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Tue Jan 24, 2012 11:35 pm  (#21) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
ragtag wrote:
I've installed GIMP on Windows 7 now, and got Python working, but I am stumped on one silly issue (or maybe it's just late).

On Linux, I generally run GIMP from the terminal, and any Python errors in my script will show up there. When I try to do the same on Windows, running gimp from the Command prompt, I don't get any errors showing up. How would I go about debugging my script under Windows?

Btw...I got GIMP Book to start, but it fails on generating thumbnails for a new book. It's probably something simple, like me using forward slashes, rather than os.path.join in the thumbnails path. :)

It could be you need to use double slashes in the path.

I wonder if i need to update my Python-2.6 version to Python-2.6.3? Maybe that is why the urllib.py module fails?
Which version of Python are you using on Windows 7?

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Wed Jan 25, 2012 12:38 am  (#22) 
Offline
GimpChat Member

Joined: Jan 22, 2012
Posts: 31
Rod: I used Python 2.6.4. In fact I followed your instructions from here to install it. :)


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Wed Jan 25, 2012 7:05 am  (#23) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Quote:
On Linux, I generally run GIMP from the terminal, and any Python errors in my script will show up there. When I try to do the same on Windows, running gimp from the Command prompt, I don't get any errors showing up. How would I go about debugging my script under Windows?


Did you try " gimp --verbose" ?
You may have to replace "gimp" with the full path for gimp.exe (not sure if will work for the 2.7.5 portable maybe in case should be the path for "gimprun.exe"

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Wed Jan 25, 2012 8:44 am  (#24) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
"gimp --verbose" on Windows is fairly pointless as it isn't in any way verbose.

I've done some debugging by adding this:
        file_new = gtk.ImageMenuItem(gtk.STOCK_NEW, agr)
        show_error_msg("in Main")
        file_new.set_label("New Book...")
        show_error_msg("in Main 2")

And I get the "in Main" message but not the "in Main 2" message. I therefore conclude that the .set_label method doesn't exist in whichever version of gtk/pygtk is being used (Typing gtk.ver into the Python console reveals 2, 14, 2)

Oh, and on my home machine:
GIMP 2.6.5 Python Console
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]

>>> import json
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ImportError: No module named json

So I'm thinking you need to specify the minimum system requirements.

Kevin


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Wed Jan 25, 2012 12:00 pm  (#25) 
Offline
GimpChat Member

Joined: Jan 22, 2012
Posts: 31
paynekj: I'm using Python 2.6.4 on the Windows machine I'm testing on. The json module you're missing was first made a part of Python in version 2.6, though it is possible to manually install it with earlier versions of Python.

I've narrowed the bug down to these lines:

        imagepathuri = urllib.quote(self.imagepath.encode("utf-8"))
        file_hash = hashlib.md5('file://'+imagepathuri).hexdigest()


The first line, would strip any spaces and other weird stuff from the path to the original image, and the second line would make a hash out of that path, which matches the name of the thumbnail. This works on Linux, but on Windows I'm getting an incorrect hash. It probably has something to do with Windows using \ and Linux using / in their paths. If anyone has a any ideas, feel free to shout out? I've tried quite a few different things, but all return an incorrect hash so far.


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Wed Jan 25, 2012 2:29 pm  (#26) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Running pdb.gimp-image-get-filename in Python returns
C:\Documents and Settings\Owner\My Documents\My Pictures\details.png
And the Image properties has it that way as well.

whereas in Script-fu it's:
C:\\Documents and Settings\\Owner\\My Documents\\My Pictures\\details.png

So which is GIMP on Windows using to create the thumbnail filename? I can't answer that, I have GIMP set to not create thumbnails - which would break your script yes/no?


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Wed Jan 25, 2012 2:55 pm  (#27) 
Offline
GimpChat Member

Joined: Jan 22, 2012
Posts: 31
I don't know any script-fu, but it's possible it's just escaping the backslashes. The path is basically the same.

My script uses Gimp to generate the thumbnails, but I'm still having trouble with the part of the code that finds the thumbnails that have been generated to show them in the Book window. It works fine on Linux, but breaks on Windows.

Basically thumbnails are named using the md5 hash of the URI path of the file (e.g. file:///home/ragtag/drawing.xcf). On Windows, I get an md5 hash, it's just not the same as the name of thumbnail generated. I think it has something to do with escaping backslashes, but all the combinations I've tried so far have failed. :(

I guess I'll have to give it another shot after work tomorrow.


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Thu Jan 26, 2012 5:36 am  (#28) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Here's a thought. The spec for thumbnail creation ( http://people.freedesktop.org/~vuntz/thumbnail-spec-cache/thumbsave.html ) makes a point of this:
Quote:
In particular this defines to use three '/' for local 'file:' resources


Which means your code is fine on a linux system because you prefix "file://" onto the front of a path that starts with the third "/". HOWEVER on windows the path doesn't start with a "/", so you are calculating the hash on a non compliant uri.

Kevin


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Thu Jan 26, 2012 2:03 pm  (#29) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
I've done some looking around in the GIMP source code and come across

g_escape_file_uri

Which changes all the backslashes into forward slashes, adds the file:// and the extra / if it's not already there on the front of the filename and uses
g_escape_uri_string with a flag to make sure some characters are not escaped, one of which appears to be the colon ":" and maybe the space?

According to this page: http://unspecified.wordpress.com/2008/05/24/uri-encoding/ it's possible to call urllib.quote and tell it not to escape some characters: urllib.quote(self.imagepath.encode("utf-8"), safe=":")

Kevin


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Thu Jan 26, 2012 5:16 pm  (#30) 
Offline
GimpChat Member

Joined: Jan 22, 2012
Posts: 31
Thanks for the tip. I'll need to look into that.

I got it working on Windows before I read your post. I skipped urllib on Windows, so it probably won't work with Chinese pages names on Windows, like it does on Linux, but at least it works now. :)

I've updated the file in the Gimp Registry, and even added a screenshot.


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Thu Jan 26, 2012 11:56 pm  (#31) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
Now it works even with Gimp 2.7.5 (XP 32 bit, Python 2.7.2).
Thank You.
Do you plan to add language file (pot)?


Attachments:
Gimp Book.png
Gimp Book.png [ 29.19 KiB | Viewed 1255 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Fri Jan 27, 2012 3:01 am  (#32) 
Offline
GimpChat Member

Joined: Jan 22, 2012
Posts: 31
Great to hear that it works in 2.7, which means it will probably work in 2.8 when that comes out too. Less re-writing for me. :)

Adding support for translation files is on my to do list, just not at the very top. As is adding support for right to left reading. On Linux, you can use Chinese, Japanese and so on, names for your pages, but I believe this won't work under Windows (need to test it).

My to do list is at the end of the book.py, if you open it in a text editor. :)


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Fri Jan 27, 2012 1:17 pm  (#33) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
I hoped something alike from long...for Xmas i had a beautiful gift (Manga studio) but still i am sure that will come still very handy...Gimp miss a similar tool till now ,thank you

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Fri Jan 27, 2012 1:26 pm  (#34) 
Offline
GimpChat Member

Joined: Jan 22, 2012
Posts: 31
Manga Studio is actually great piece of software for making comics, especially black and white ones for print. I own Manga Studio EX and have made a comic book with it, so I can't claim that it wasn't an inspiration for GIMP Book. :)


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Fri Jan 27, 2012 6:24 pm  (#35) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
I had to update to Python-2.6.4, redo my PATH variable to read Python26 files and i was all set.
The newer update works excellent in Gimp-2.6.11 on Windows XP.
Thanks for a great plug-in Ragtag! :)
Nicely done.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Mon Apr 09, 2012 2:04 pm  (#36) 
Offline
GimpChat Member

Joined: Jan 22, 2012
Posts: 31
I just uploaded an updated GIMP Book plug-in to the Gimp Plug-In Registry. I've changed the following:

# - Added storyboard mode, where the pages flow, rather than display in two columns.
# - Added page numbers to title bar.
# - Added right click menu to pages, for quicker access to adding, deleting and renaming pages.
# - Added gimp icon to dialog and windows..
# - Bugfix - Clicking 'No' button in the delete page dialog now works.
# - Bugfix - Window can be made smaller.

I've also tested it briefly in Gimp 2.8 RC1 on Linux, and it seems to work. I haven't tested using the layer tagging with the new layer groups, but I imagine that it could break something. That said, layer groups will be great for doing comics, as you can have one layer group per panel, group speech bubbles together and so on.


Top
 Post subject: Re: GIMP Book - new plug-in for managing multiple pages...
PostPosted: Mon Apr 09, 2012 5:33 pm  (#37) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Thanks Ragtag! :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Any tips for managing an 'epic' map? I appear to be CPU bound.

0

No new posts Attachment(s) Don't work procedures plug-in-bump-map, plug-in-displace

2

No new posts A wizard's book store

5

No new posts Ladies / Comic Book panel

0

No new posts Comic book/Flat colors look filter

1



* Login  



Powered by phpBB3 © phpBB Group