| View previous topic :: View next topic |
| Author |
Message |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Wed Nov 16, 2005 7:46 am Post subject: .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 |
|
| Back to top |
|
 |
seventoes
Joined: 02 Oct 2005 Posts: 79
|
Posted: Wed Nov 16, 2005 9:15 am Post subject: |
|
|
well gif is a copywrited technology...
Just open the pix in paint and then save them as a .png and use libpng |
|
| Back to top |
|
 |
Gary13579
Joined: 15 Aug 2005 Posts: 93
|
Posted: Wed Nov 16, 2005 9:25 am Post subject: |
|
|
| seventoes wrote: | well gif is a copywrited technology...
Just open the pix in paint and then save them as a .png and use libpng |
There's probably a reason he needs it to be GIF and not PNG.
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). |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Wed Nov 16, 2005 7:03 pm Post subject: |
|
|
| Gary13579 wrote: | | seventoes wrote: | well gif is a copywrited technology...
Just open the pix in paint and then save them as a .png and use libpng |
There's probably a reason he needs it to be GIF and not PNG.
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.
Maybe, the ungif library could be ported to have better gif support. |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Fri Nov 18, 2005 2:46 am Post subject: |
|
|
| I'll have a look into ungif, and continue looking at iiviewer. Hopefully it will work OK. |
|
| Back to top |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Fri Nov 18, 2005 3:22 am Post subject: |
|
|
| seventoes wrote: | well gif is a copywrited technology...
Just open the pix in paint and then save them as a .png and use libpng |
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/lzw |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Fri Nov 18, 2005 4:00 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
Zenurb
Joined: 30 Sep 2005 Posts: 106 Location: United Kingdom
|
Posted: Fri Nov 18, 2005 6:00 am Post subject: |
|
|
Just convert your GIFs to MNG and use the lovely animated png format instead. _________________ Proud Dvorak User
US 1.5 PSP (Original) |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Fri Nov 18, 2005 7:36 am Post subject: |
|
|
| It's not that simple, if I could change the format, then I would. I don't have control over 3rd party images, and .gif is a popular format that I need to support. |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Fri Nov 18, 2005 7:40 am Post subject: |
|
|
| AnonymousTipster wrote: | | Is there much difference between libgif and libungif? |
I read once that there is no much difference when reading gif files, only when creating them (in this case, libgif is better) |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Fri Nov 18, 2005 7:52 am Post subject: |
|
|
| Ok, i'll have a look at libungif in the morning. Thanks. |
|
| Back to top |
|
 |
digihoe
Joined: 14 May 2005 Posts: 108
|
Posted: Fri Nov 18, 2005 9:25 pm Post subject: |
|
|
You need GIF for browser port, right? Are you planing any javascript support BTW? I think it is essential...
Good luck and best regards! |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Sat Nov 19, 2005 2:51 am Post subject: |
|
|
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.). |
|
| Back to top |
|
 |
Zenurb
Joined: 30 Sep 2005 Posts: 106 Location: United Kingdom
|
Posted: Sat Nov 19, 2005 5:55 am Post subject: |
|
|
| AnonymousTipster 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.). |
Building a browser from the ground up may be your only option _________________ Proud Dvorak User
US 1.5 PSP (Original) |
|
| Back to top |
|
 |
shifty
Joined: 16 Jun 2005 Posts: 32 Location: MIT
|
Posted: Mon Nov 21, 2005 1:28 pm Post subject: 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. |
|
| Back to top |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Mon Nov 21, 2005 6:21 pm Post subject: Re: gif expires soon |
|
|
The footnote on this page says:
| Quote: |
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).
|
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. |
|
| Back to top |
|
 |
seventoes
Joined: 02 Oct 2005 Posts: 79
|
Posted: Sat Dec 03, 2005 2:44 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Sun Dec 18, 2005 12:00 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
daurnimator

Joined: 11 Dec 2005 Posts: 38 Location: melbourne, australia
|
Posted: Sat Feb 18, 2006 6:40 pm Post subject: |
|
|
| How did you go with this? |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Sat Feb 18, 2006 7:22 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
.: Smerity :.
Joined: 04 Feb 2006 Posts: 9
|
Posted: Sat Feb 18, 2006 8:02 pm Post subject: |
|
|
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-list/1998-December/msg01803.html
Last edited by .: Smerity :. on Sat Feb 18, 2006 8:13 pm; edited 1 time in total |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Sat Feb 18, 2006 8:12 pm Post subject: |
|
|
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++ |
|
| Back to top |
|
 |
.: Smerity :.
Joined: 04 Feb 2006 Posts: 9
|
Posted: Sat Feb 18, 2006 8:26 pm Post subject: |
|
|
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/libungif/libungif/lib/dgif_lib.c?rev=1.1.1.1&view=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 |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Sat Feb 18, 2006 8:42 pm Post subject: |
|
|
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; |
|
| Back to top |
|
 |
.: Smerity :.
Joined: 04 Feb 2006 Posts: 9
|
Posted: Sat Feb 18, 2006 8:59 pm Post subject: |
|
|
http://mail.gnome.org/archives/gnome-list/1998-October/msg01246.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...> |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Sat Feb 18, 2006 9:31 pm Post subject: |
|
|
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? |
|
| Back to top |
|
 |
.: Smerity :.
Joined: 04 Feb 2006 Posts: 9
|
Posted: Sat Feb 18, 2006 9:54 pm Post subject: |
|
|
Yeah, sorry mate, if I suggested anything else now I'd be completely clutching at straws. Hopefully someone with more experience in this area can come in and be a hero.
Best of luck... |
|
| Back to top |
|
 |
MikeDX
Joined: 19 Oct 2005 Posts: 30
|
Posted: Sun Feb 19, 2006 4:18 am Post subject: |
|
|
| seventoes wrote: | well gif is a copywrited technology...
Just open the pix in paint and then save them as a .png and use libpng |
there is NOTHING about what you have said that makes any sense whatsoever.
However, the LZW patent expired last year worldwide and quite a few OSS projects have reimplemented GIF with LZW supprt. |
|
| Back to top |
|
 |
AnonymousTipster
Joined: 01 Jul 2005 Posts: 197
|
Posted: Fri Feb 24, 2006 4:27 am Post subject: |
|
|
Can anyone help with this?
It is crucial that the browser has .gif support, and to do so, I need this library. |
|
| Back to top |
|
 |
|