Discussion:
[Clanlib-devel] On further investigation regarding PNG files
Dan Palm
2006-01-12 16:59:28 UTC
Permalink
On further investigation, using the VC7 precompiled
libpng with clanlib 0.7.8 works, that is to say,
RBG-mode PNG files load perfectly, which would
implicate clanlib 0.8 as the problem I'm encountering.
If it would be helpful I could attach an RPG-mode PNG,
but they can also be obtained simply by opening an
image in an editor like the GIMP and going
Image->Mode->RGB.

By the way, I have my subscription to this mailing
list set to batch up and send once a day, so I might
not get responses right away. I'm changing that
setting now, so that I will get e-mails on this list
as they are sent.

Also, to Jason: thanks for the tip regarding the XML
problem I had encountered in 0.7.8. I was able to pull
the latest code from subversion and the XML did indeed
work again. Now if I could just get my game to not be
neon-pink :-)

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Jason Green
2006-01-12 17:39:33 UTC
Permalink
Post by Dan Palm
If it would be helpful I could attach an RPG-mode PNG,
but they can also be obtained simply by opening an
image in an editor like the GIMP and going
Image->Mode->RGB.
Just tried that using a modified Basic2D example with a couple of
different RGB-mode PNGs, and I can't duplicate the problem on the latest
ClanLib 0.8 SVN. Tried in both OpenGL & SDL mode, and both seemed
fine. Can you attach the image and possibly some sample code that
causes the issue for you?
Post by Dan Palm
Also, to Jason: thanks for the tip regarding the XML
problem I had encountered in 0.7.8. I was able to pull
the latest code from subversion and the XML did indeed
work again.
You're welcome. :-)
Post by Dan Palm
Now if I could just get my game to not be
neon-pink :-)
What do you have against neon-pink? It's the new black, you know. ;-)

Jason
Dan Palm
2006-01-12 18:15:47 UTC
Permalink
Interesting, I tried the same thing (modifying the
basic2d example to use RGB-mode PNGs), and for me, it
turned them pink. I believe I'm using GL mode, as I
don't have the SDL libraries installed. I tried this
under Windows although I could try it on my linux box
as well (I develop on both). I don't know yet if it
reproduces under linux.

As for example code, I tried the Surface example, but
saved the pcx file as a PNG file using the GIMP, in
both indexed and RGB mode and in RGB mode the colors
went funny, so theres really nothing special about my
code. I have surfaces defined in a resources.xml with
no special tags or anything, just plain old png files
and I load them the same way that the surface example
does.

I'll attach a PNG that I actually use in the game, but
I don't think it will be any different than the ones
you tested with.

It's a mystery!

I switched back to clanlib 0.7.8 and everything worked
again, using the same libpng and all, so it must be a
clanlib 0.8 issue somehow...

-Dan
Post by Jason Green
Post by Dan Palm
If it would be helpful I could attach an RPG-mode
PNG,
Post by Dan Palm
but they can also be obtained simply by opening an
image in an editor like the GIMP and going
Image->Mode->RGB.
Just tried that using a modified Basic2D example
with a couple of
different RGB-mode PNGs, and I can't duplicate the
problem on the latest
ClanLib 0.8 SVN. Tried in both OpenGL & SDL mode,
and both seemed
fine. Can you attach the image and possibly some
sample code that
causes the issue for you?
Post by Dan Palm
Also, to Jason: thanks for the tip regarding the
XML
Post by Dan Palm
problem I had encountered in 0.7.8. I was able to
pull
Post by Dan Palm
the latest code from subversion and the XML did
indeed
Post by Dan Palm
work again.
You're welcome. :-)
Post by Dan Palm
Now if I could just get my game to not be
neon-pink :-)
What do you have against neon-pink? It's the new
black, you know. ;-)
Jason
-------------------------------------------------------
Post by Jason Green
This SF.net email is sponsored by: Splunk Inc. Do
you grep through log files
for problems? Stop! Download the new AJAX search
engine that makes
searching your log files as easy as surfing the
web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Post by Jason Green
_______________________________________________
clanlib-devel mailing list
https://lists.sourceforge.net/lists/listinfo/clanlib-devel
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Jason Green
2006-01-12 18:33:00 UTC
Permalink
Post by Dan Palm
I'll attach a PNG that I actually use in the game, but
I don't think it will be any different than the ones
you tested with.
You're right. Works fine for me, but I'm using it as a CL_Sprite
instead of CL_Surface (but I really don't think that should matter).
Post by Dan Palm
I switched back to clanlib 0.7.8 and everything worked
again, using the same libpng and all, so it must be a
clanlib 0.8 issue somehow...
I guess your best bet is to do a diff of the png_provider files from
0.7.8 to 0.8.0 and see what all has changed. Maybe a certain function
call was changed. I had issues with an older video driver and 0.8, so
there may be something configured "correctly" now, but non-functional
because old drivers don't use the "now correct" method. Also, try
installing the SDL libs (available at the website) and compiling
ClanSDL. Then, add "#define USE_SDL" to the top of the Basic2D example
and see what happens. Could be a problem in ClanGL.

good luck!
Sean Heber
2006-01-12 18:36:12 UTC
Permalink
Post by Jason Green
Post by Dan Palm
I'll attach a PNG that I actually use in the game, but
I don't think it will be any different than the ones
you tested with.
You're right. Works fine for me, but I'm using it as a CL_Sprite
instead of CL_Surface (but I really don't think that should matter).
It can and probably does matter. I don't have the time to check into
it right now, though, but that one difference is somewhat important
at times. This sounds like an odd endian problem again.

l8r
Sean
Jason Green
2006-01-12 18:34:08 UTC
Permalink
Something else - try converting that surface to a pixelbuffer, then
convert that buffer into a different format (rgba8888), and making a new
surface out of that - see if that one displays correctly.
Dan Palm
2006-01-12 18:43:20 UTC
Permalink
Hmm....... if memory serves me, and I'll check when I
get home, but i THINK that the graphics I loaded with
CL_Sprite worked, it was the surface style graphics
that didn't work.

If thats the case, I'm guessing that would help us get
to the bottom of it. And right now I think thats the
case, I think the sprites were OK....
Post by Dan Palm
Post by Jason Green
Post by Dan Palm
I'll attach a PNG that I actually use in the
game, but
Post by Jason Green
Post by Dan Palm
I don't think it will be any different than the
ones
Post by Jason Green
Post by Dan Palm
you tested with.
You're right. Works fine for me, but I'm using it
as a CL_Sprite
Post by Jason Green
instead of CL_Surface (but I really don't think
that should matter).
It can and probably does matter. I don't have the
time to check into
it right now, though, but that one difference is
somewhat important
at times. This sounds like an odd endian problem
again.
l8r
Sean
-------------------------------------------------------
Post by Dan Palm
This SF.net email is sponsored by: Splunk Inc. Do
you grep through log files
for problems? Stop! Download the new AJAX search
engine that makes
searching your log files as easy as surfing the
web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Post by Dan Palm
_______________________________________________
clanlib-devel mailing list
https://lists.sourceforge.net/lists/listinfo/clanlib-devel
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Jason Green
2006-01-12 18:49:56 UTC
Permalink
Post by Dan Palm
Hmm....... if memory serves me, and I'll check when I
get home, but i THINK that the graphics I loaded with
CL_Sprite worked, it was the surface style graphics
that didn't work.
Just tried it via this code and it worked fine, too:

CL_Surface sur("valyn.png");

Haven't tried the resource.xml method for loading surfaces, though. Can
you send your xml?
Jason Green
2006-01-12 18:54:25 UTC
Permalink
Nevermind, just tried it with the resources.xml from the Surface
example, and it worked fine, too. Both in SDL and GL mode on Windows.
My guess is it's your video card driver and how CL .8 acts with it
versus how .7.8 acted.

Join #clanlib at irc.freenode.net when you get some time and we can try
to debug it.
Dan Palm
2006-01-12 18:47:07 UTC
Permalink
Jason-
I don't have the right clanlib set up at the computer
I'm using right now. If its convenient for you, could
you try using CL_Surface and see if that makes a
difference? If you try the Surface example with my PNG
instead of that PCX for example, that would be a good
experiment.
Post by Jason Green
Post by Dan Palm
I'll attach a PNG that I actually use in the game,
but
Post by Dan Palm
I don't think it will be any different than the
ones
Post by Dan Palm
you tested with.
You're right. Works fine for me, but I'm using it
as a CL_Sprite
instead of CL_Surface (but I really don't think that
should matter).
Post by Dan Palm
I switched back to clanlib 0.7.8 and everything
worked
Post by Dan Palm
again, using the same libpng and all, so it must be
a
Post by Dan Palm
clanlib 0.8 issue somehow...
I guess your best bet is to do a diff of the
png_provider files from
0.7.8 to 0.8.0 and see what all has changed. Maybe
a certain function
call was changed. I had issues with an older video
driver and 0.8, so
there may be something configured "correctly" now,
but non-functional
because old drivers don't use the "now correct"
method. Also, try
installing the SDL libs (available at the website)
and compiling
ClanSDL. Then, add "#define USE_SDL" to the top of
the Basic2D example
and see what happens. Could be a problem in ClanGL.
good luck!
-------------------------------------------------------
Post by Jason Green
This SF.net email is sponsored by: Splunk Inc. Do
you grep through log files
for problems? Stop! Download the new AJAX search
engine that makes
searching your log files as easy as surfing the
web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Post by Jason Green
_______________________________________________
clanlib-devel mailing list
https://lists.sourceforge.net/lists/listinfo/clanlib-devel
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Dan Palm
2006-01-12 18:55:05 UTC
Permalink
Well the first occurance of the problem is in the
splash screen, which loads a simple PNG and just
throws it on the screen, and the xml is just like

<surface name="splash"
file="/Images/Screens/splash.png" />

nothing fancy. I don't think its related to the
resources.... I would expect that loading it directly,
as you did with valyn.png, would reproduce the
problem..... When I get a chance I will try using
SDL...
Post by Jason Green
Post by Dan Palm
Hmm....... if memory serves me, and I'll check when
I
Post by Dan Palm
get home, but i THINK that the graphics I loaded
with
Post by Dan Palm
CL_Sprite worked, it was the surface style graphics
that didn't work.
CL_Surface sur("valyn.png");
Haven't tried the resource.xml method for loading
surfaces, though. Can
you send your xml?
-------------------------------------------------------
Post by Jason Green
This SF.net email is sponsored by: Splunk Inc. Do
you grep through log files
for problems? Stop! Download the new AJAX search
engine that makes
searching your log files as easy as surfing the
web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Post by Jason Green
_______________________________________________
clanlib-devel mailing list
https://lists.sourceforge.net/lists/listinfo/clanlib-devel
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Continue reading on narkive:
Loading...