PureBasic Forum
http://forums.purebasic.com/english/

png metadata
http://forums.purebasic.com/english/viewtopic.php?f=3&t=71186
Page 1 of 1

Author:  Rinzwind [ Wed Aug 08, 2018 3:26 pm ]
Post subject:  png metadata

Would be nice if we can add text to a png file to describe the default or custom properties. The libpng PB uses supports it.

Author:  Seymour Clufley [ Sat Sep 19, 2020 5:58 pm ]
Post subject:  Re: png metadata

+1

PNG EXIF metadata has now been standardised. EXIF has always been standardised for JPEG and TIFF (though not JPEG2000).

One way to implement it would be by extending LoadImage() and SaveImage() with a pointer to an EXIF data structure:
Code:
Structure NativePBExifStructure
; standard EXIF fields
EndStructure

fn.s = "C:\my-diagram.png"
img = LoadImage(#PB_Any,fn,@exif.NativePBExifStructure)
exif\DateTimeOriginal = Date()
SaveImage(img,fn,#PB_ImagePlugin_PNG,flags,depth,@exif)


But it might be simpler and more efficient to implement it as separate commands, like this:
Code:
ReadImageEXIFData(filename,@exif.NativePBExifStructure)
WriteImageEXIFData(filename,@exif.NativePBExifStructure)

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/