PNG image en- and de-coders.. 2020 update

Andy Balba pwplus7 at gmail.com
Thu Aug 13 01:44:01 UTC 2020


On Wednesday, 12 August 2020 at 21:59:20 UTC, aberba wrote:
> On Tuesday, 11 August 2020 at 18:29:28 UTC, Andy Balba wrote:
>> Found this 2012 Forum post : 
>> https://forum.dlang.org/post/jrklsj$2lt9$1@digitalmars.com
>> and thought that D-folks interested in this topic may find an 
>> "update" helpful.
>>
>> [...]
>
> Recommended to someone and it was well liked. Thanks for doing 
> this.
>
> It seems getting image dimensions for .gif files isn't 
> supported though. Or is it that .gif files aren't supported at 
> all?
>
>>   // format specific functions
>>   PNG_Header hdr = read_png_header("peruna.png");
>>   IFImage i3 = read_jpeg("porkkana.jpg");
>>   write_tga("porkkana.tga", i3.w, i3.h, i3.pixels);

gif image format is not supported at all, only png, bmp, tga and 
jpeg.
For jpeg only decoding is supported.

When generating my own image files, I prefer to stick with png 
format.
Non-png formatted images that I obtain from external sources, 
fall into two categories:
- those I only want to view i just pass on to image viewer 
software.
- those I want to modify in any way, are first converted to png 
format using on-line image-format converters. Then I work with 
the png file using various C++ apps I previously developed prior 
to my transition to Dlang.

I'm currently converting my most heavily-used C++ apps to D


More information about the Digitalmars-d mailing list