.GIF support, viable?
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
.GIF support, viable?
I'm currently working on an app which requires .gif support. Animated preferably, but standard will work too. Problem is that .gif is no longer an open format, which poses a problem, because there isn't a libgif in SVN, and the .gif loader in SDLimage seems quite closely tied to SDL for a standard file - char load.
What i'm asking is: has anybody worked .gif support into a project of theirs, or does anyone know of a way that I could incorporate .gifs into my app without changing the format?
Failing that, does anyone know of any simple libraries that I could port for the PSP?
EDIT: I've found a small loader in a program called iiviewer which may help me. I'd still like to know if this has been done before though
What i'm asking is: has anybody worked .gif support into a project of theirs, or does anyone know of a way that I could incorporate .gifs into my app without changing the format?
Failing that, does anyone know of any simple libraries that I could port for the PSP?
EDIT: I've found a small loader in a program called iiviewer which may help me. I'd still like to know if this has been done before though
There's probably a reason he needs it to be GIF and not PNG.seventoes wrote:well gif is a copywrited technology...
Just open the pix in paint and then save them as a .png and use libpng
I saw a GIF viewer in PSP PDA (formerly known as PSP Notepad), but I don't think it is open source, and it really isn't the best (some colors get screwed up).
PSP-PDA uses the SDL_Image library from the svn, so the gif reading is implemented in that library and it's open source.Gary13579 wrote:There's probably a reason he needs it to be GIF and not PNG.seventoes wrote:well gif is a copywrited technology...
Just open the pix in paint and then save them as a .png and use libpng
I saw a GIF viewer in PSP PDA (formerly known as PSP Notepad), but I don't think it is open source, and it really isn't the best (some colors get screwed up).
Maybe, the ungif library could be ported to have better gif support.
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
AFAIK using GIF was never a problem, but the LZW algorithm. But looks like the patent expired last year: http://www.unisys.com/about__unisys/lzwseventoes wrote:well gif is a copywrited technology...
Just open the pix in paint and then save them as a .png and use libpng
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
Well, that's good news. Do all .gifs use the LZW algorithm, or was it an improvement that Unisys introduced?
EDIT: Seeing as the patents have expired, that means I can use libgif instead of libungif. I can't find libgif (there doesn't seem to be a homepage like for png and jpeg), but I can find libungif.
Is there much difference between libgif and libungif?
EDIT: Seeing as the patents have expired, that means I can use libgif instead of libungif. I can't find libgif (there doesn't seem to be a homepage like for png and jpeg), but I can find libungif.
Is there much difference between libgif and libungif?
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
Yes. I haven't looked too deep into Dillo's source code yet, if it supports javascript, then the 1.5 browser will too. If not, we'll hopefully build in some basic support, but only for simple essential commands like close() addbookmark() etc, but not good enough for games.
The GU based graphical engine is coming along quite nicely, and it supports .PNG, i'm in the process of adding .jpg. Afterwards, I want to add .gif and TTF support.
I'm just hoping that we'll actually end up with a functioning browser, because if so, the sky is the limit (built-in media view/playing, VoIP, Online Radio stations, flash support etc.).
The GU based graphical engine is coming along quite nicely, and it supports .PNG, i'm in the process of adding .jpg. Afterwards, I want to add .gif and TTF support.
I'm just hoping that we'll actually end up with a functioning browser, because if so, the sky is the limit (built-in media view/playing, VoIP, Online Radio stations, flash support etc.).
Building a browser from the ground up may be your only optionAnonymousTipster wrote:Yes. I haven't looked too deep into Dillo's source code yet, if it supports javascript, then the 1.5 browser will too. If not, we'll hopefully build in some basic support, but only for simple essential commands like close() addbookmark() etc, but not good enough for games.
The GU based graphical engine is coming along quite nicely, and it supports .PNG, i'm in the process of adding .jpg. Afterwards, I want to add .gif and TTF support.
I'm just hoping that we'll actually end up with a functioning browser, because if so, the sky is the limit (built-in media view/playing, VoIP, Online Radio stations, flash support etc.).
Proud Dvorak User
US 1.5 PSP (Original)
US 1.5 PSP (Original)
gif expires soon
1) according to
http://www.gnu.org/philosophy/gif.html
the LZW (part of GIF) patent will expire in August 2006! You might as well go
for it in the meantime! Who's going to bother with a few teenagers
with a free distribution over the next year? A good place to find
gif source code is the "xv" source code (a prg for displaying GIFs, jpegs,
etc under the x window operating system). I've ported that code myself
several times. it's pretty clean. The author is pretty wacky. Here's his
webpage: http://www.trilon.com/xv/ And here's the
downloads page for source: http://www.trilon.com/xv/downloads.html
2) Yes, you can have legal GIFs that don't use LZW! They're just not
compressed, so they end up being very big, like 8-bit color indexed
BMP files. I wouldn't waste my time with this though :P
3) no idea if that code is supports animations, but if you get that far, then
I'll dig up my gif animator source code I got from some kid in Germany
for you.
http://www.gnu.org/philosophy/gif.html
the LZW (part of GIF) patent will expire in August 2006! You might as well go
for it in the meantime! Who's going to bother with a few teenagers
with a free distribution over the next year? A good place to find
gif source code is the "xv" source code (a prg for displaying GIFs, jpegs,
etc under the x window operating system). I've ported that code myself
several times. it's pretty clean. The author is pretty wacky. Here's his
webpage: http://www.trilon.com/xv/ And here's the
downloads page for source: http://www.trilon.com/xv/downloads.html
2) Yes, you can have legal GIFs that don't use LZW! They're just not
compressed, so they end up being very big, like 8-bit color indexed
BMP files. I wouldn't waste my time with this though :P
3) no idea if that code is supports animations, but if you get that far, then
I'll dig up my gif animator source code I got from some kid in Germany
for you.
Re: gif expires soon
The footnote on this page says:shifty wrote:1) according to
http://www.gnu.org/philosophy/gif.html
the LZW (part of GIF) patent will expire in August 2006!
I don't know, what the IBM patent exactly is, but I think chances are good, that IBM doesn't care, if some homebrew program uses GIF images and looks like if you don't live in the USA, it is no problem at all any more :-) But of course, MNG is better for small animated graphics, because it supports true color.We were able to search the patent databases of the USA, Canada, Japan, and the European Union. The Unisys patent expired on 20 June 2003 in the USA, in Europe it expired on 18 June 2004, in Japan patent expired on 20 June 2004 and in Canada it expired on 7 July 2004. The U.S. IBM patent expires 11 August 2006, (we are still searching the databases of other countries).
Wow.. now i look at who started the post and i realize why he cant convert the images xD Im not sure if he wants me revieling his project.. but PSPU put it on the front page so i guess its ok....
Hes workin on a web browser :D *happy happy*
I know he already has png, jpeg, and ttf (fonts) support, i dont know about anything else but i know its coming along well.
Hes workin on a web browser :D *happy happy*
I know he already has png, jpeg, and ttf (fonts) support, i dont know about anything else but i know its coming along well.
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
OK, well. I've got the latest source of libungif. I've made the library and installed it to the library directory. Putting -lungif in the makefile works, and my app can find the gif_lib.h file. However, I get undefined references to the library functions, such as DGifOpenFilename(). The structs work fine (e.g. GifFileType), it's just the functions.
Can anyone help?
Can anyone help?
- daurnimator
- Posts: 38
- Joined: Sun Dec 11, 2005 8:36 pm
- Location: melbourne, australia
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
Well, it appears that libungif will compile the library fine (with errors elsewhere, but the library is formed OK), but it doesn't link correctly, and gives me errors like: undefined reference to 'DGifOpenFileName'
I'm sure i've seen this problem before with libraries, but I have forgotten how to solve it.
I'm sure i've seen this problem before with libraries, but I have forgotten how to solve it.
-
- Posts: 9
- Joined: Sat Feb 04, 2006 11:43 pm
- Contact:
Doesn't that usually mean that the Makefile hasn't been told to link the library, thus isn't finding the reference functions?
Not sure what the signifier would be for libungif though...
-lgif or -lungif maybe?
(and just for curiosity sakes, have you ported over libungif yourself, or is it at an SVN somewhere? Can't see it on svn.pspdev.org)
-Edit-
Confirmed as -lungif at http://mail.gnome.org/archives/gnome-li ... 01803.html
Not sure what the signifier would be for libungif though...
-lgif or -lungif maybe?
(and just for curiosity sakes, have you ported over libungif yourself, or is it at an SVN somewhere? Can't see it on svn.pspdev.org)
-Edit-
Confirmed as -lungif at http://mail.gnome.org/archives/gnome-li ... 01803.html
Last edited by .: Smerity :. on Sat Feb 18, 2006 8:13 pm, edited 1 time in total.
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
Makefile:
TARGET = browser
OBJS = main.o p_sprint.o
INCDIR = "/home/Paul/pspgames/freetype/include"
CFLAGS = -O2 -G0 -Wall -I../curl/include -L../curl -I../libungif/lib -L../libungif/lib/.libs
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
LIBS= -lcurl -lpsp_req -lpspdebug -lpspsdk -lpspwlan -lpspnet_apctl -lpspnet_resolver -lc -lpspnet_inet -lpspnet -lstdc++ -lpspgum -lpspgu -lpng -ljpeg -lungif -lz -lm -lfreetype -lpsppower
I'm pretty sure that i'm including the library and neccessary headers.
libungif.a comes out as 202kb, FYI, just in case it isn't compiling fully.
Also, in the .libs directory, there is a dgif_lib.a file, which may need to be included, but I don't know what it's signifier would be.
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Eclipse
PSP_EBOOT_ICON = "icon0.png"
PSP_EBOOT_PIC1 = "eclipsebg.png"
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
EDIT: I found somewhere that you can fix this problem by adding exern "C" around the #include <gif_lib.h> but that doesn't help me, as I am already in C, not C++
TARGET = browser
OBJS = main.o p_sprint.o
INCDIR = "/home/Paul/pspgames/freetype/include"
CFLAGS = -O2 -G0 -Wall -I../curl/include -L../curl -I../libungif/lib -L../libungif/lib/.libs
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
LIBS= -lcurl -lpsp_req -lpspdebug -lpspsdk -lpspwlan -lpspnet_apctl -lpspnet_resolver -lc -lpspnet_inet -lpspnet -lstdc++ -lpspgum -lpspgu -lpng -ljpeg -lungif -lz -lm -lfreetype -lpsppower
I'm pretty sure that i'm including the library and neccessary headers.
libungif.a comes out as 202kb, FYI, just in case it isn't compiling fully.
Also, in the .libs directory, there is a dgif_lib.a file, which may need to be included, but I don't know what it's signifier would be.
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Eclipse
PSP_EBOOT_ICON = "icon0.png"
PSP_EBOOT_PIC1 = "eclipsebg.png"
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
EDIT: I found somewhere that you can fix this problem by adding exern "C" around the #include <gif_lib.h> but that doesn't help me, as I am already in C, not C++
-
- Posts: 9
- Joined: Sat Feb 04, 2006 11:43 pm
- Contact:
Not exactly sure what to suggest then.
Check your libungif source to make sure that DGifOpenFileName is in dgif_lib, it seems they excluded it for the GBA version (just incase you're using the GBA tree).
- When Compiling for Game Boy Advance, file functions are not needed so
exclude DGifOpenFileName(), DGifOpenFileHandle(), DGifSlurp(), and
PrintGifError().
http://cvs.sourceforge.net/viewcvs.py/l ... iew=markup
If it's only that single command then it may very well be something to do with the GBA tree, as you'd usually get a lot more errors from a completely missing lib I'd assume
Checking out other probable causes now
Check your libungif source to make sure that DGifOpenFileName is in dgif_lib, it seems they excluded it for the GBA version (just incase you're using the GBA tree).
- When Compiling for Game Boy Advance, file functions are not needed so
exclude DGifOpenFileName(), DGifOpenFileHandle(), DGifSlurp(), and
PrintGifError().
http://cvs.sourceforge.net/viewcvs.py/l ... iew=markup
If it's only that single command then it may very well be something to do with the GBA tree, as you'd usually get a lot more errors from a completely missing lib I'd assume
Checking out other probable causes now
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
Any DGif function causes the undefined reference, so I also get the same error with DGifGetRecordName DGifCloseFile DGifGetScreenDesc DGifGetLine. So it clearly can't find any of the functions, which would suggest a missing library, but it's definitely -lungif, and my makefile is pointing to the directory where it is: -L../libungif/lib/.libs
I know it can find the .h files, as it doesn't complain about using the structures such as GifFileType *gifFile; GifRecordType *gifType; GifPixelType *gifLine;
I know it can find the .h files, as it doesn't complain about using the structures such as GifFileType *gifFile; GifRecordType *gifType; GifPixelType *gifLine;
-
- Posts: 9
- Joined: Sat Feb 04, 2006 11:43 pm
- Contact:
http://mail.gnome.org/archives/gnome-li ... 01246.html
He said that he worked around it using -lgif...
He seems to be getting all the same errors as you
The reply quotes -
Hmm: this sometimes happens because you ran "./autogen.sh" before you
had the gif library installed, and then you installed the gif library
but did not remove config.cache in imlib.
<I should also apologise, at this point I'm clutching at straws...>
He said that he worked around it using -lgif...
He seems to be getting all the same errors as you
The reply quotes -
Hmm: this sometimes happens because you ran "./autogen.sh" before you
had the gif library installed, and then you installed the gif library
but did not remove config.cache in imlib.
<I should also apologise, at this point I'm clutching at straws...>
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am
I think that reply was in relation to imlib, so he ran the ./autogen.sh for imlib without having the libungif libraries installed.
If I put in -lgif, the linker complains that it cannot find it.
EDIT: And in response to your earlier question, I got libungif from it's homepage, and compiled it straight off. As I said, it compiled the library fine, but errored out later on with example sources (I think). When compiling the library, there isn't anything particular you need to do to get it to compile for the PSP, is there?
If I put in -lgif, the linker complains that it cannot find it.
EDIT: And in response to your earlier question, I got libungif from it's homepage, and compiled it straight off. As I said, it compiled the library fine, but errored out later on with example sources (I think). When compiling the library, there isn't anything particular you need to do to get it to compile for the PSP, is there?
-
- Posts: 9
- Joined: Sat Feb 04, 2006 11:43 pm
- Contact:
there is NOTHING about what you have said that makes any sense whatsoever.seventoes wrote:well gif is a copywrited technology...
Just open the pix in paint and then save them as a .png and use libpng
However, the LZW patent expired last year worldwide and quite a few OSS projects have reimplemented GIF with LZW supprt.
-
- Posts: 197
- Joined: Fri Jul 01, 2005 2:50 am