After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 159564 - Py-slice should be able to generate simple dhtml animation and link stubs
Py-slice should be able to generate simple dhtml animation and link stubs
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Gimp-Python
git master
Other All
: Normal enhancement
: 2.4
Assigned To: Manish Singh
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-11-26 15:54 UTC by Joao S. O. Bueno
Modified: 2005-09-25 21:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
new proposed py-slice (10.53 KB, application/x-python)
2004-11-26 15:57 UTC, Joao S. O. Bueno
  Details
Patch which adds the new behavior to py-slice (11.61 KB, patch)
2005-02-24 19:55 UTC, Joao S. O. Bueno
none Details | Review
Updated patch, diffed from CVS HEAD today. (11.63 KB, patch)
2005-07-09 21:26 UTC, Joao S. O. Bueno
none Details | Review
Latest patch.I think it is fine now. (15.82 KB, patch)
2005-07-17 04:03 UTC, Joao S. O. Bueno
none Details | Review

Description Joao S. O. Bueno 2004-11-26 15:54:49 UTC
For however makes html pages on the old fashioned way, perl-o-tine and 
py-slice are great. 
 
However, even for a simple "hover" effect, the ammount of html to be written  
can become huge. 
 
So, I added to py-slice the ability to auto-build a simple DHTML animation for 
onmouseover and onmousedown, picking the bitmaps from the bottom-most image 
visible layers. 
 
I also added stubs for the html anchor tabs that would surround a normal image 
inside a table.
Comment 1 Joao S. O. Bueno 2004-11-26 15:57:12 UTC
Created attachment 34158 [details]
new proposed py-slice

The changes are somewhat big, and the whole file will bemore readable than a
patch.
Comment 2 Sven Neumann 2004-11-26 16:32:14 UTC
The point about a patch is not being readable but that it allows to see the
changes and that it can be merged with other changes. If one wants to see the
complete file, that's as simple as applying the patch.
Comment 3 Carol 2004-11-26 17:40:00 UTC
i am wondering if it would be better named "py-dyslice.py" instead.
Comment 4 Joao S. O. Bueno 2004-11-28 02:05:00 UTC
I will post a patch after I fine tune some more of the html attributes into 
css them.  
As for the menu entry "py-slice" I actually find it misleading - there is no 
way one could find out what it does without trying it - the only hint is that 
it is something "web related", since it goes in filters->web.  
 
 
Comment 5 Carol 2004-11-28 02:37:40 UTC
I have installed this plug-in.  My earlier suggestion was silly.  This plug-in
does all of the old stuff and some new also.  Sorry.
Comment 6 weskaggs 2005-02-24 19:11:00 UTC
setting to NEEDINFO because this awaits input from Joao
Comment 7 Joao S. O. Bueno 2005-02-24 19:55:46 UTC
Created attachment 37915 [details] [review]
Patch which adds the new behavior to py-slice

Oops,
I thought I had done this already.
Comment 8 Manish Singh 2005-03-05 08:46:45 UTC
Hm, why'd you remove the tag capitalization feature?
Comment 9 Joao S. O. Bueno 2005-03-05 14:30:48 UTC
I was worried about not clutering the GUI very much.  
 
And, now, thinking on it, I think I have something personal against uppercase 
html tags.  
 
But it is ok to add it back - it just did not occur me that people might 
actually use it. 
 
 
Comment 10 Sven Neumann 2005-04-05 10:59:25 UTC
Removing NEEDINFO (Joao, you should have done that when adding the requested
information).
Comment 11 Michael Schumacher 2005-07-07 16:21:02 UTC
I recall that people were asking for this sort of thing on the mailing lists
and/or IRC, so we should consider to add it for 2.4. I'm going to test if it
still works...
Comment 12 Joao S. O. Bueno 2005-07-08 01:42:33 UTC
I had a recent conflict in a recent CVS UP with the Capital Letters option i
removed from the plug-in. Besides that, it still works.

If people think that having an option for capitalizing html tags is worth the UI
clutter I can add it back.  (The current way capitalization is done will not
work wtih my version IIRC)
Comment 13 Michael Schumacher 2005-07-08 08:08:21 UTC
Could you attach an updated patch? The attached one doesn't apply anymore.
Comment 14 Michael Schumacher 2005-07-08 10:11:38 UTC
Re capitalization: afaik xhtml requires lowercase, doesn't it?
Comment 15 Joao S. O. Bueno 2005-07-09 21:26:58 UTC
Created attachment 48881 [details] [review]
Updated patch, diffed from CVS HEAD  today.

I was away from home the other day. Here goes the patch.
Comment 16 Michael Schumacher 2005-07-11 17:20:55 UTC
I've tried the patch and it seems to work fine. There are some details that
could be improved (for example, alt=" " could be alt="", and maybe some rules
from the CSS style attributes could be extracted into CSS classes).

But one thing is IMO important:

Either 

- there should be a warning (ALL UPPERCASE, and very prominent in general) that
this are just building blocks for a document

or

- the output from this script should be a complete, 100% XHTML strict compliant
document
Comment 17 Joao S. O. Bueno 2005-07-11 17:53:49 UTC
In regard to #16: 
I will review the code later to check for such details. 
 
AS for xhmtl compliance that is a problem I would like to know a work around 
to: 
There is javascript embeded into he output. The correct way to embed 
javascript is to put it into a CDATA field, so that it can hold '>' and '<' 
characters - 
but a few mainstream browsers do not support this CDATA field (at this moment 
I do not even know what exactly is and what is the sintax for this CDATA - I 
am just remebering something I read a while ago) - if you can point me 
somwhere to read about this, I will be fine. 
 
Or else, we could just insert the suggested warning. 
Comment 18 Michael Schumacher 2005-07-12 08:12:28 UTC
The syntax is describe in the "Differences with HTML 4" section of the XHTML 1.0
specs: http://www.w3.org/TR/2000/REC-xhtml1-20000126/#diffs (see subsection 4.8)

As an alternative to inline scripts, it is recommended to use an external script
if certain characters may appear inside the script (see Appdendix C.4). 

BTW, what mainstream browsers can't handle CDATA?
Comment 19 Michael Schumacher 2005-07-15 13:43:18 UTC
Joao, do you have any changes already or should I have a look at this this weekend?
Comment 20 Joao S. O. Bueno 2005-07-17 01:06:13 UTC
I was working on it today, but I had a probelm with indexed images. 
I am using gimp_layer_new_from_drawable- but it has a bug for indexed images  
- it comes all black.  
 
And people will want to use this script to generate indexed PNGs (I do) - 
I jave to close ont hisother bug before this script gets really ready. 
 
Moreover, I have to special case RGB + gif and INDEXED + jpg - they are not 
working currently. 
 
As for the sugestions in #16, I opted for puttin a warning comment. A fum 
xhtml document has to have a <head> and <body>  and can't be simply embedded 
in another HTML document (using server side includes for example). I worked a 
little on the html style, however, so it  can now be embeded in xhtml without 
problems. 
 
I also added a new feature: when saving to an already existing py-slice 
generated file, it will read the URLs that may have been hand-edited  in the 
file that will be overwritten and preserves them. 
Comment 21 Joao S. O. Bueno 2005-07-17 04:03:07 UTC
Created attachment 49310 [details] [review]
Latest patch.I think it is fine now.

There it is. I updated the text that is displayed on the dialog to give
a clue on the new feature.
As for the problem with indexed images: I was using
gimp_layer_new_from_drawable, but I can't do it for layers that will live o n
new images, because these new images don't have  a colormap yet. I worked
around it.
Any combination of RGB, GRAY and INDEXED is working fine with either image type
as well. (I think that the version on CVS now will fail if one picks .gif with
an RGB image)
Comment 22 Carol 2005-09-25 21:38:14 UTC
I committed this patch to cvs:
2005-09-25  Carol Spears  <carol@gimp.org>

	* plug-ins/pygimp/plug-ins/py-slice.py added the patch from
        Joao S. O. Bueno Calligaris that was attached to 
        http://bugzilla.gnome.org/show_bug.cgi?id=159564

Now, we need only to await for xhtml validation errors from people using the
CAPS option (if it is still there).
Comment 23 Michael Schumacher 2005-09-25 21:48:03 UTC
Any problems with the oputput of the script should go into new reports.
Resolving as FIXED.