Re: [pygtk] GdkImLib: Image(filename) seems to cache

2002-06-18 Thread James Henstridge

Thomas Guettler wrote:

>Hi!
>
>I use GdkImLib.Image(filename) to load and display jpeg files. The
>picture gets displayed on a window where the user can choose to rotate
>the image:
>
>img=GdkImLib.Image(filename)
>#(1)... rotate filename with shell script calling image-magic
>img=GdkImLib.Image(filename)
>
>The second time I load it, it is not rotated although the jpeg data
>got rotated. Does GdkImLib cache the image?
>  
>
Yes.  If you call "img.changed()" after creating the first 
GdkImlib.Image object.  If you want a library with more predictable 
behaviour, try using the gdk-pixbuf binding.

James.

-- 
Email: [EMAIL PROTECTED]  | Linux.conf.au 2003 Call for Papers out
WWW:   http://www.daa.com.au/~james/ |   http://conf.linux.org.au/cfp.html




___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] GdkImLib: Image(filename) seems to cache

2002-06-18 Thread Jonathan Blandford

Thomas Guettler <[EMAIL PROTECTED]> writes:

> Hi!
> 
> I use GdkImLib.Image(filename) to load and display jpeg files. The
> picture gets displayed on a window where the user can choose to rotate
> the image:
> 
> img=GdkImLib.Image(filename)
> #(1)... rotate filename with shell script calling image-magic
> img=GdkImLib.Image(filename)
> 
> The second time I load it, it is not rotated although the jpeg data
> got rotated. Does GdkImLib cache the image?
> 
> It even gets stranger: If I add img=None at (1) the image
> gets rotated if I rotate it 90 or 270 degrees. If it gets
> rotated 180 I still see the old picture.
> 
> Does someone know why the images gets cached?

Yes.  It's due to Imlib's broken caching scheme.  This is essentially
unfixable.  You want to use gdk_pixbuf instead, if possible.

-Jonathan
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



[pygtk] GdkImLib: Image(filename) seems to cache

2002-06-18 Thread Thomas Guettler

Hi!

I use GdkImLib.Image(filename) to load and display jpeg files. The
picture gets displayed on a window where the user can choose to rotate
the image:

img=GdkImLib.Image(filename)
#(1)... rotate filename with shell script calling image-magic
img=GdkImLib.Image(filename)

The second time I load it, it is not rotated although the jpeg data
got rotated. Does GdkImLib cache the image?

It even gets stranger: If I add img=None at (1) the image
gets rotated if I rotate it 90 or 270 degrees. If it gets
rotated 180 I still see the old picture.

Does someone know why the images gets cached?

 thomas


-- 
Thomas Guettler <[EMAIL PROTECTED]>
http://www.thomas-guettler.de

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] GdkImlib under MS Windows ?

2002-06-06 Thread pygtk-admin

On Thu, Jun 06, 2002 at 03:32:25PM -0400, Petursson, Runar wrote:

> I haven't found any information on running GdkImlib under windows.  My
> latest attempt has been using cygwin, but I've yet to get that to work.
> 
> If anybody out there has any ideas, they'd be appreciated.

  Well, it might not be the answer you wanted, but according to the
gnome documentation, if you plan to work with gnome 2.0, you should
switch to gdk-pixbuf, which actually works under windows :

  http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/a4076.html

  Hope this help,

-- 
Prof
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



RE: [pygtk] GdkImlib under MS Windows ?

2002-06-06 Thread Cedric Gustin

At 03:32 PM 6/6/2002 -0400, Petursson, Runar wrote:
>I haven't found any information on running GdkImlib under windows.  My
>latest attempt has been using cygwin, but I've yet to get that to work.
>
>If anybody out there has any ideas, they'd be appreciated.

See http://groups.yahoo.com/group/gimpwin-dev/message/91

The native port of gdkimlib has been "abandoned" by the author of gtk+ on 
win32. I guess the only solution is to compile gtk+-1.2, gdkimlib and pygtk 
for X11 using cygwin and its port of XFree 4.2.

The other solution is to port your application to pygtk-1.99.x !

Good Luck

Cedric

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



RE: [pygtk] GdkImlib under MS Windows ?

2002-06-06 Thread Petursson, Runar

I haven't found any information on running GdkImlib under windows.  My
latest attempt has been using cygwin, but I've yet to get that to work.

If anybody out there has any ideas, they'd be appreciated.

Runar

-Original Message-
From: Thomas Guettler [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 06, 2002 12:47 PM
To: Petursson, Runar
Cc: [EMAIL PROTECTED]
Subject: Re: [pygtk] GdkImlib under MS Windows ?


On Tue, May 28, 2002 at 01:47:30PM -0400, Petursson, Runar wrote:
> Hello,
> 
>   I am trying to port an existing Python (pygtk) application to run
> under Windows.  The library that I am unable to find for windows is
> GdkImlib.  Is there an existing windows port (any version at this point)?
> If not, are there reasons why it might not compile (dependencies?).
Another
> direction I might have to go with the port is cygwin, but that's of course
> not as ideal as a more native windows dll.

Hi!

I am developing an application which uses gdkImLib, too. Someday I
want to port it to window. Did you succeed in getting it running on
windows?

 thomas

-- 
Thomas Guettler <[EMAIL PROTECTED]>
http://www.thomas-guettler.de
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] GdkImlib under MS Windows ?

2002-06-06 Thread Thomas Guettler

On Tue, May 28, 2002 at 01:47:30PM -0400, Petursson, Runar wrote:
> Hello,
> 
>   I am trying to port an existing Python (pygtk) application to run
> under Windows.  The library that I am unable to find for windows is
> GdkImlib.  Is there an existing windows port (any version at this point)?
> If not, are there reasons why it might not compile (dependencies?).  Another
> direction I might have to go with the port is cygwin, but that's of course
> not as ideal as a more native windows dll.

Hi!

I am developing an application which uses gdkImLib, too. Someday I
want to port it to window. Did you succeed in getting it running on
windows?

 thomas

-- 
Thomas Guettler <[EMAIL PROTECTED]>
http://www.thomas-guettler.de

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



[pygtk] GdkImlib under MS Windows ?

2002-05-28 Thread Petursson, Runar

Hello,

I am trying to port an existing Python (pygtk) application to run
under Windows.  The library that I am unable to find for windows is
GdkImlib.  Is there an existing windows port (any version at this point)?
If not, are there reasons why it might not compile (dependencies?).  Another
direction I might have to go with the port is cygwin, but that's of course
not as ideal as a more native windows dll.

Thanks for any help,

Runar
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



[pygtk] GdkImlib question

2001-06-21 Thread Russell Nelson

In my pygps application, I've got a map that moves as you walk around
with your GPS connected to your laptop or (in my case) Linux iPAQ.
But I'm having a really weird problem.  I do this to load the map:

img = GdkImlib.Image("maps/"+world[8])

and I save it in a global variable.  Then, later, I do this:

img.render() 
pix, mask = img.get_pixmap()
print img, pix, mask
win = mapd.get_window()
if win:
# draw the map on the pixmap.
# if this map does not completely cover the screen, we might want to
# draw another map next to this one.
draw_pixmap(map_pixmap, mapd.get_style().white_gc, pix,
current_map_center[0] - win.width/2, current_map_center[1] - 
win.height/2,
0,0, win.width,win.height)

See that print statement?  When the program works, it prints this:

  None

If I move the img.render() call immediately after I load the map, it
prints this:

  None

Is there anything I can do about this?  Obviously I can't draw a
Pixmap using a Window, so the draw_pixmap() fails.  I'd really prefer
to leave the image rendered so I can scribble the user's movements on
the pixmap in the form of an arrow.  Also, I'd like to be able to zoom
in or out, so I'll render the pixmap twice or half size.  That's an
expensive operation, so I'd like to only do it once.

-- 
-russ nelson <[EMAIL PROTECTED]>  http://russnelson.com
Crynwr sells support for free software  | PGPok | 
521 Pleasant Valley Rd. | +1 315 268 1925 voice | #exclude 
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | 
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] GdkImlib?

2001-02-20 Thread James Henstridge

On Tue, 20 Feb 2001, Russell Nelson wrote:

> I'm trying to figure out how to make GdkImlib work with a drawing
> area.  I've got a glade-written pygtk application (GPS interface) and
> I want to load a pixmap into a drawing area.  I'm trying to use the
> following code in the configure event for the drawing area, but I get
> the following error after the last line below:
> 
> TypeError: gdk_draw_pixmap, argument 3: expected GdkWindow, instance found
> 
> map_pixmap = create_pixmap(win, win.width, win.height, -1)
> draw_rectangle(map_pixmap, widget.get_style().white_gc, TRUE,
>0, 0, win.width, win.height)
> img = GdkImlib.Image('page01.gif')
> img.render()
> pix = img.make_pixmap()
  Change this to:
  pix, mask = img.get_pixmap()
> draw_pixmap(map_pixmap, widget.get_style().white_gc, pix, 0,0, 0,0, 
>win.width,win.height)

If the pixmap has some transparency, then you will want to set the
clipmask for the GC first.  If it is just a normal square pixmap, you can
ignore the mask.

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] GdkImlib?

2001-02-20 Thread Russell Nelson

I'm trying to figure out how to make GdkImlib work with a drawing
area.  I've got a glade-written pygtk application (GPS interface) and
I want to load a pixmap into a drawing area.  I'm trying to use the
following code in the configure event for the drawing area, but I get
the following error after the last line below:

TypeError: gdk_draw_pixmap, argument 3: expected GdkWindow, instance found

map_pixmap = create_pixmap(win, win.width, win.height, -1)
draw_rectangle(map_pixmap, widget.get_style().white_gc, TRUE,
   0, 0, win.width, win.height)
img = GdkImlib.Image('page01.gif')
img.render()
pix = img.make_pixmap()
draw_pixmap(map_pixmap, widget.get_style().white_gc, pix, 0,0, 0,0, 
win.width,win.height)

-- 
-russ nelson <[EMAIL PROTECTED]>  http://russnelson.com
Crynwr sells support for free software  | PGPok | "This is Unix...
521 Pleasant Valley Rd. | +1 315 268 1925 voice | Stop acting so helpless."
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | --Daniel J. Bernstein

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] GdkImlib

2000-06-08 Thread Eric Gillespie, Jr.

On Thu, Jun 08, 2000 at 12:21:51AM +0100,
Paul Clifford <[EMAIL PROTECTED]> wrote:
> It looks like your version of imlib was compiled without
> built-in xpm support and tried to fall back on ImageMagick to
> convert the xpm file

No, i found out what it was. There are two problems, though i
don't know what's causing them. I've filed bug reports.
Everything works perfectly in C, so i don't know what's going on.

The first problem is that for some reason Imlib doesn't think it
knows how to load PNGs any images when accessed from Python.
Because of this, it tries to use convert from ImageMagick.
Unfortunately, it doesn't have the correct path to conver (it's
using /convert).

That is the problem with the Helix packages. The normal Debian
packages only have the first problem. They successfully load
images with convert, but transparency doesn't work. Imlib loads
the images without convert when accessed from a C program.

-- 
Eric Gillespie, Jr. <*> [EMAIL PROTECTED]

"With sufficient thrust, pigs fly just fine. However, this is not
 necessarily a good idea. It is hard to be sure where they are
 going to land, and it could be dangerous sitting under them as
 they fly overhead."
 --RFC 1925

 PGP signature


Re: [pygtk] GdkImlib

2000-06-07 Thread Paul Clifford

"Eric Gillespie, Jr." wrote:

> Has anyone had any luck using GdkImlib? I can't get it to load
> any images at all. The following simple program
> 
> from GdkImlib import *
> image = Image("/home/epg/test.xpm")
> 
> gives the following error message:
> 
> /convert: No such file or directory
> gdk_imlib ERROR: Cannot load image: /home/epg/1.xpm
> All fallbacks failed.

It looks like your version of imlib was compiled without built-in xpm
support and tried to fall back on ImageMagick to convert the xpm file
into something it could handle.  Since "convert" wasn't found you either
don't have ImageMagick on your system, or your PATH doesn't include the
directory convert was installed in.  The best solution would be to
recompile imlib with xpm support, but you could try installing
ImageMagick (or updating your PATH if it's already installed) if you
want a quick fix.

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] GdkImlib

2000-06-07 Thread who noway


Eric Gillespie, Jr. wrote:
> For me, this program dies at the same place my test did (in
> Image.__init__). What versions do you have? I have gnome-python
> 0.6.6 and imlib 1.9.8

I've got imlib 1.9.5 and pygtk 0.6.5


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] GdkImlib

2000-06-06 Thread Eric Gillespie, Jr.

On Tue, Jun 06, 2000 at 06:14:23AM -0400,
who noway <[EMAIL PROTECTED]> wrote:
> again.  Btw, the following little program works over here:
> 
> #!/usr/bin/python
> from gtk import *
> import GdkImlib
> 
> win = GtkWindow ()
> win.connect ("destroy", mainquit)
> im = GdkImlib.Image ("/home/epg/test.xpm")
> im.render ()  # don't forget this
> pix = im.make_pixmap ()   # or this
> win.add (pix)
> pix.show ()
> 
> win.show ()
> mainloop ()

For me, this program dies at the same place my test did (in
Image.__init__). What versions do you have? I have gnome-python
0.6.6 and imlib 1.9.8.

-- 
Eric Gillespie, Jr. <*> [EMAIL PROTECTED]

"With sufficient thrust, pigs fly just fine. However, this is not
 necessarily a good idea. It is hard to be sure where they are
 going to land, and it could be dangerous sitting under them as
 they fly overhead."
 --RFC 1925

 PGP signature


Re: [pygtk] GdkImlib

2000-06-06 Thread who noway


> Has anyone had any luck using GdkImlib? I can't get it to load
> any images at all.  The following simple program
>
> from GdkImlib import *
> image = Image("/home/epg/test.xpm")
>
> gives the following error message:
>
> /convert: No such file or directory
> gdk_imlib ERROR: Cannot load image: /home/epg/1.xpm
> All fallbacks failed.

Is it "/home/epg/test.xpm"  or  "/home/epg/1.xpm" ??  Check the filename
again.  Btw, the following little program works over here:

#!/usr/bin/python
from gtk import *
import GdkImlib

win = GtkWindow ()
win.connect ("destroy", mainquit)
im = GdkImlib.Image ("/home/epg/test.xpm")
im.render ()# don't forget this
pix = im.make_pixmap () # or this
win.add (pix)
pix.show ()

win.show ()
mainloop ()


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] GdkImlib

2000-06-05 Thread Eric Gillespie, Jr.

Has anyone had any luck using GdkImlib? I can't get it to load
any images at all. The following simple program

from GdkImlib import *
image = Image("/home/epg/test.xpm")

gives the following error message:

/convert: No such file or directory
gdk_imlib ERROR: Cannot load image: /home/epg/1.xpm
All fallbacks failed.

-- 
Eric Gillespie, Jr. <*> [EMAIL PROTECTED]

"With sufficient thrust, pigs fly just fine. However, this is not
 necessarily a good idea. It is hard to be sure where they are
 going to land, and it could be dangerous sitting under them as
 they fly overhead."
 --RFC 1925

 PGP signature