Hey all,
I've had trouble loading some TIFs generated in pd/Gem in PIL (python imaging). I asked on the list and it seems PIL expects some particular TIF tags being set in order to recognize the image.
I think it can only be an improvement to add these tags so that tifs generated in pd/Gem can be loaded by as many applications as possible.
The attachment contains the specific tags.
Thanks, B. Bogart
hi
B. Bogart wrote:
Hey all,
I've had trouble loading some TIFs generated in pd/Gem in PIL (python imaging). I asked on the list and it seems PIL expects some particular TIF tags being set in order to recognize the image.
ok, i have fixed this now.
I think it can only be an improvement to add these tags so that tifs generated in pd/Gem can be loaded by as many applications as possible.
The attachment contains the specific tags.
nevertheless: Gem tries to default to use imagemagick for reading/writing images (on lin and win). imagemagick does produce correct files (with all tifftags set). the missing tifftags only occured (though this is know fixed) when using the fallback libtiff library. is there any reason why you are not using imagemagick?
mfg.ui.,xdf IOhannes
IOhannes m zmoelnig a écrit : ....
nevertheless: Gem tries to default to use imagemagick for reading/writing images (on lin and win). imagemagick does produce correct files (with all tifftags set). the missing tifftags only occured (though this is know fixed) when using the fallback libtiff library. is there any reason why you are not using imagemagick?
there was a bug in debian that make imagemagick to crash on exception. so i did never include imagemagick on GEM/linux build.
BTW : is this bug resolve?
cyrille
mfg.ui.,xdf IOhannes
GEM-dev mailing list GEM-dev@iem.at http://lists.puredata.info/listinfo/gem-dev
cyrille henry wrote:
IOhannes m zmoelnig a écrit : ....
nevertheless: Gem tries to default to use imagemagick for reading/writing images (on lin and win). imagemagick does produce correct files (with all tifftags set). the missing tifftags only occured (though this is know fixed) when using the fallback libtiff library. is there any reason why you are not using imagemagick?
there was a bug in debian that make imagemagick to crash on exception. so i did never include imagemagick on GEM/linux build.
BTW : is this bug resolve?
afaik, yes.
fgmadsr IOhannes
Hi Johannes,
Same reason as Cyrille,
I did a quick compile at some point, imagemagick caused a segfault, and so I turned it off and have not turned it back on.
I'll give that a try and and report the bug if it still exists.
I hope it will also fix the Y-flip issue I have with pix_buffer_save.
I'll need to save lots of copies of the same image into a pix_buffer. Obviously copying from mem will be much faster than copying from disk.
How about a pix_buffer message to copy from one slot to another?
Then I could load a black image into all slot with something like:
open black.tif 0 copy 0 1 copy 1 2 . . .
B. Bogart
IOhannes m zmoelnig wrote:
hi
B. Bogart wrote:
Hey all,
I've had trouble loading some TIFs generated in pd/Gem in PIL (python imaging). I asked on the list and it seems PIL expects some particular TIF tags being set in order to recognize the image.
ok, i have fixed this now.
I think it can only be an improvement to add these tags so that tifs generated in pd/Gem can be loaded by as many applications as possible.
The attachment contains the specific tags.
nevertheless: Gem tries to default to use imagemagick for reading/writing images (on lin and win). imagemagick does produce correct files (with all tifftags set). the missing tifftags only occured (though this is know fixed) when using the fallback libtiff library. is there any reason why you are not using imagemagick?
mfg.ui.,xdf IOhannes
IOhannes m zmoelnig wrote:
B. Bogart wrote:
How about a pix_buffer message to copy from one slot to another?
Then I could load a black image into all slot with something like:
open black.tif 0 copy 0 1 copy 1 2 .
i think this is a good idea. please file a feature-request.
well, forget about that.
fgmasdr IOhannes
After enabling imagemagick:
saved TIFs are no longer Y flipped and are PIL readable.
saving a YUV buffer to tif crashes PD:
terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct NULL not valid
Program received signal SIGABRT, Aborted. [Switching to Thread 0xb7d0e6b0 (LWP 31986)] 0xb7faf424 in __kernel_vsyscall () (gdb) bt #0 0xb7faf424 in __kernel_vsyscall () #1 0xb7d3b640 in raise () from /lib/i686/cmov/libc.so.6 #2 0xb7d3d018 in abort () from /lib/i686/cmov/libc.so.6 #3 0xb7114928 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6 #4 0xb7112805 in ?? () from /usr/lib/libstdc++.so.6 #5 0xb7112842 in std::terminate () from /usr/lib/libstdc++.so.6 #6 0xb711297a in __cxa_throw () from /usr/lib/libstdc++.so.6 #7 0xb70aa94f in std::__throw_logic_error () from /usr/lib/libstdc++.so.6 #8 0xb70ee88a in ?? () from /usr/lib/libstdc++.so.6 #9 0xb70ee986 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string () from /usr/lib/libstdc++.so.6 #10 0xb7b6b532 in mem2magickImage () from ./Gem.pd_linux #11 0xb7b6b833 in mem2image () from ./Gem.pd_linux #12 0xb7bd14ee in pix_buffer::saveMess () from ./Gem.pd_linux #13 0xb7bd0fb5 in pix_buffer::saveMessCallback () from ./Gem.pd_linux #14 0x080afdea in pd_typedmess (x=0x9259350, s=0x91ace80, argc=2, argv=0x812a590) at m_class.c:781 #15 0x080b221f in outlet_anything (x=0x94ada08, s=0x91ace80, argc=2, argv=0x812a590) at m_obj.c:439 #16 0x080af9ab in pd_typedmess (x=0x937a28c, s=0x91ace80, argc=2, argv=0x812a590) at m_class.c:800 #17 0x080b5963 in binbuf_eval (x=0x925af40, target=0x937a28c, argc=1, ---Type <return> to continue, or q <return> to quit--- argv=0xbfbc90cc) at m_binbuf.c:677 #18 0x0806370b in message_click (x=0x937a270, xpos=460, ypos=421, shift=0, ctrl=0, alt=0) at g_text.c:308 #19 0x080686d0 in text_click (z=0x937a270, glist=0x937bf50, xpix=460, ypix=421, shift=0, alt=0, dbl=0, doit=1) at g_text.c:1091 #20 0x0808df40 in canvas_doclick (x=0x937bf50, xpos=460, ypos=421, which=1, mod=<value optimized out>, doit=1) at g_editor.c:93 #21 0x0808e6b7 in canvas_mousedown (x=0x937bf50, xpos=460, ypos=421, which=1, mod=0) at g_editor.c:1256 #22 0x080afe21 in pd_typedmess (x=0x937bf50, s=0x9174c78, argc=4, argv=0x812a568) at m_class.c:779 #23 0x080af9ab in pd_typedmess (x=0x9329930, s=0x9174c78, argc=4, argv=0x812a568) at m_class.c:800 #24 0x080b5963 in binbuf_eval (x=0x918ed88, target=0x9329930, argc=0, argv=0x0) at m_binbuf.c:677 #25 0x080c2150 in socketreceiver_read (x=0x918edf8, fd=10) at s_inter.c:553 #26 0x080c0f37 in sys_domicrosleep (microsec=<value optimized out>, pollem=<value optimized out>) at s_inter.c:193 #27 0x080bd660 in m_scheduler () at m_sched.c:489 #28 0x080c0805 in sys_main (argc=3, argv=0xbfbc9734) at s_main.c:318 #29 0x080cc0df in main (argc=Cannot access memory at address 0x7cf2 ) at s_entry.c:31 (gdb)
libtiff just saved an unreadable tif in this case.
I'll add my copy idea to the tracker.
.b.
IOhannes m zmoelnig wrote:
hi
B. Bogart wrote:
Hey all,
I've had trouble loading some TIFs generated in pd/Gem in PIL (python imaging). I asked on the list and it seems PIL expects some particular TIF tags being set in order to recognize the image.
ok, i have fixed this now.
I think it can only be an improvement to add these tags so that tifs generated in pd/Gem can be loaded by as many applications as possible.
The attachment contains the specific tags.
nevertheless: Gem tries to default to use imagemagick for reading/writing images (on lin and win). imagemagick does produce correct files (with all tifftags set). the missing tifftags only occured (though this is know fixed) when using the fallback libtiff library. is there any reason why you are not using imagemagick?
mfg.ui.,xdf IOhannes
B. Bogart wrote:
After enabling imagemagick:
saved TIFs are no longer Y flipped and are PIL readable.
good.
since i think i have fixed the tiftag problem, would you mind to _also_ test with imagemagick disabled? (sorry for the back-and-forth requests)
saving a YUV buffer to tif crashes PD:
but, it will give you a warning that it doesn't know how to handle YUV-images just before crashing ;-|
libtiff just saved an unreadable tif in this case.
readable but without much meaning, i would say.
anyhow, i'll have a look into it.
I'll add my copy idea to the tracker.
why?
fgmar IOhannes
B. Bogart wrote:
After enabling imagemagick:
saved TIFs are no longer Y flipped and are PIL readable.
saving a YUV buffer to tif crashes PD:
terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct NULL not valid
should be fixed now.
fgmasdr IOhannes
Hey all,
So after getting back into using libtif to write image files, they are still not quite right.
1. I'm not using imagemagick because it conflicts with gphoto.
2. Still loading tifs into python-imaging.
Looks like its a bounds problem. "identify" tells me this about the pix_buffer saved tifs:
frame_00000.tif TIFF 640x480 640x480-2147483648-2147483648 8-bit DirectClass 1.172mb
Notice the bizarre geometry.
I'm using the 0.92 branch, maybe this is fixed in trunk?
thanks, .b.
On 08-11-05 03:16 AM, IOhannes m zmoelnig wrote:
hi
B. Bogart wrote:
Hey all,
I've had trouble loading some TIFs generated in pd/Gem in PIL (python imaging). I asked on the list and it seems PIL expects some particular TIF tags being set in order to recognize the image.
ok, i have fixed this now.
I think it can only be an improvement to add these tags so that tifs generated in pd/Gem can be loaded by as many applications as possible.
The attachment contains the specific tags.
nevertheless: Gem tries to default to use imagemagick for reading/writing images (on lin and win). imagemagick does produce correct files (with all tifftags set). the missing tifftags only occured (though this is know fixed) when using the fallback libtiff library. is there any reason why you are not using imagemagick?
mfg.ui.,xdf IOhannes