Porting LodePNG to PureC [solved]

C and PASCAL (or any other high-level languages) in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2257
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Porting LodePNG to PureC [solved]

Postby lp » Wed Sep 23, 2015 8:05 pm

I ported LodePNG but I'm having a few issue I can't seem to resolve. It compiles ok, however all chunks report a bad CRC32. Also all the Alder32 check-sums are bad as well. However, if these checks are disabled (an option) then it will load some png files. So obviously there's something wrong with my port. Some png files report chunk sizes over 2gb which is impossible. Looking at them with a file editor reveals correct chunk sizes, so something is going wrong while its scanning the chunks. If anyone into PureC is willing to help or have a look at it, the original project is here: http://lodev.org/lodepng/

My ported sources are at my public dropbox: https://www.dropbox.com/sh/hk65mapqd3fm ... KqQTa?dl=0 (In folder \lodepng)
You don't need zView, it builds a standalone prg file, just drop a png file on it, after building it.

The idea was to wrap it into a codec for vZview, which I did already, but with all the problems noted above. It's loading maybe about 50% of the png files I try. It weighs in at about 27kb, which is quite a bit smaller than the original png.ldg module supplied with zView. It could be used directly in other projects as well, if it was reliable.
Last edited by lp on Sun Oct 02, 2016 4:07 pm, edited 1 time in total.

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2257
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: Porting LodePNG to PureC

Postby lp » Sun Oct 02, 2016 4:06 pm

I guess no one was interested in this. Anyway I finally got libpng to build under PureC, weighs in at about 70kb which is still a lot smaller than the gcc build. ;)

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1559
Joined: Sun Jul 31, 2011 1:11 pm

Re: Porting LodePNG to PureC [solved]

Postby Eero Tamminen » Sun Oct 02, 2016 8:42 pm

16-bit vs. 32-bit int issue with lodePNG?

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2257
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: Porting LodePNG to PureC [solved]

Postby lp » Sun Oct 02, 2016 8:51 pm

I checked it over several times for that exact issue, but had no luck. It's not at my dropbox anymore. Anyone can still grab it from the original site if interested in making it work.

User avatar
shoggoth
Nature
Nature
Posts: 854
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: Porting LodePNG to PureC [solved]

Postby shoggoth » Mon Oct 03, 2016 5:07 am

What was the problem?
Ain't no space like PeP-space.

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2257
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: Porting LodePNG to PureC [solved]

Postby lp » Mon Oct 03, 2016 1:11 pm

The problem is described in the first post. But, alternately libpng + zlib did build for me so its not a big deal.


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 1 guest