png metadata

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Rinzwind
Enthusiast
Enthusiast
Posts: 636
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

png metadata

Post by Rinzwind »

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.
Seymour Clufley
Addict
Addict
Posts: 1233
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: png metadata

Post by Seymour Clufley »

+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: Select all

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: Select all

ReadImageEXIFData(filename,@exif.NativePBExifStructure)
WriteImageEXIFData(filename,@exif.NativePBExifStructure)
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: png metadata

Post by IdeasVacuum »

The ability to read Exif data would be very very useful +1
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: png metadata

Post by davido »

+1 and +1
DE AA EB
Post Reply