Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"01-10-09 - Simple Image"

5 Comments -

1 – 5 of 5
Blogger NeARAZ said...

stb_image.h to the rescue?

January 14, 2009 at 1:55 AM

Blogger Michael said...

I recently hit this -- just switching the dll projects over to static libs (so I could forget about dll delivery) worked for me.

Also, windows GDI+ provides png/jpg bitmap class so I'm using it for now; and there's a mac equiv for my other platforms.

January 14, 2009 at 8:04 AM

Blogger cbloom said...

Yeah, switching to static libs is better, though libpng doesn't ship a static lib so I have to build their project (fingers crossed), and it also sucks cuz I make a whole bunch of tiny command line utils like "crop" , "resize" , etc. and now they'll all be 250k

Hmm.. it seems like you should be able to "link in a DLL" , like actually grab the code out of the DLL at link time and turn it into a static linkage, is that possible?

... STB_image is totally almost awesome. I didn't realize he had PNG in there too or I would've just used that instead of getting into libpng at all. However, it doesn't really fix the retarded overcomplex format - he just supports a simple subset of PNG which is a little bit disturbing to me.

January 14, 2009 at 9:53 AM

Anonymous Anonymous said...

Since I added interlaced support, I think these days the only PNG restriction in stb_image is 8-bit depth. I guess it wouldn't be that hard to add 1/2/4-bit unpacking, but you just don't find those in the wild very much anyway (since it compresses on bytes with an arithmetic-y prediction, it's not going to work very well for bit-packed stuff, I think... although that's already true for paletted stuff too).

I recently hit this -- just switching the dll projects over to static libs (so I could forget about dll delivery) worked for me.

Just be careful of what libs you do this with, since LGPL libs require shipping as DLLs. (I guess this isn't true for zlib and libpng, at least, so it does work in this case.)

January 14, 2009 at 3:31 PM

Blogger Sam said...

I too have used GDI+ which should be pretty much automatically available everywhere (so one less DLL to think about). It's a bit of mucking around because you have to create a bunch of crap to just copy the data out into a char array (create a stream, GlobalAlloc a buffer, etc) but at least you don't have to distribute extra DLLs (though of course then it's not linked into your binary).

January 14, 2009 at 4:14 PM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.