New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SUGGESTION: URI in the meta data of SVG.PNG files #212
Comments
SVG already supports this (URL written to Copyright meta data). For png, see https://sharp.pixelplumbing.com/api-output#withmetadata
Notes from https://exiftool.org/TagNames/EXIF.html:
For png, also add Copyright info:
This would take care of writing the data. Reading and interpreting would be the next task. |
After a few tries it looks like sharp doesn't support png metadata. We have the option to save jpeg instead of png (smaller file - although compressed, the svg is always available for pristine quality) or turn to an external tool to save png metadata. |
const ExifTool = require("exiftool-vendored").ExifTool
const exiftool = new ExifTool({ taskTimeoutMillis: 500 })
async function runner() {
await exiftool
.write("oyoy-6.png", {
"PNG:SOURCE": "https://charactercreator.org/#skinColor=%235c3836&irisColor=%23552200&hairColor=%231a1a1a&pupils=round&sex=m&body_head=oblong&ears=outstretched&nose=syrid&emotion=omg&shirt=turtleneck&shirtColor=%23BEE9C5&pants=cargo&pantsColor=%23b19f92&belt=utility&hat=chinese_farmer&hatColor=%23b19f92&glasses=round&shoes=loafers&tie=neck&tieColor=%23b19f92"
})
exiftool.end()
}
runner().catch(console.error) Et on trouve le output: {
SourceFile: '/home/millette/exif/oyoy-6.png',
errors: [],
ExifToolVersion: 12.4,
FileName: 'oyoy-6.png',
Directory: '/home/millette/exif',
FileSize: '111 KiB',
FileModifyDate: ExifDateTime {
year: 2022,
month: 4,
day: 9,
hour: 14,
minute: 48,
second: 55,
millisecond: 0,
tzoffsetMinutes: -240,
rawValue: '2022:04:09 14:48:55-04:00',
zoneName: 'UTC-4'
},
FileAccessDate: ExifDateTime {
year: 2022,
month: 4,
day: 9,
hour: 14,
minute: 48,
second: 55,
millisecond: 0,
tzoffsetMinutes: -240,
rawValue: '2022:04:09 14:48:55-04:00',
zoneName: 'UTC-4'
},
FileInodeChangeDate: ExifDateTime {
year: 2022,
month: 4,
day: 9,
hour: 14,
minute: 48,
second: 55,
millisecond: 0,
tzoffsetMinutes: -240,
rawValue: '2022:04:09 14:48:55-04:00',
zoneName: 'UTC-4'
},
FilePermissions: '-rw-rw-r--',
FileType: 'PNG',
FileTypeExtension: 'png',
MIMEType: 'image/png',
ImageWidth: 1000,
ImageHeight: 1000,
BitDepth: 8,
ColorType: 'RGB with Alpha',
Compression: 'Deflate/Inflate',
Filter: 'Adaptive',
Interlace: 'Noninterlaced',
PixelsPerUnitX: 2835,
PixelsPerUnitY: 2835,
PixelUnits: 'meters',
Source: 'https://charactercreator.org/#skinColor=%235c3836&irisColor=%23552200&hairColor=%231a1a1a&pupils=round&sex=m&body_head=oblong&ears=outstretched&nose=syrid&emotion=omg&shirt=turtleneck&shirtColor=%23BEE9C5&pants=cargo&pantsColor=%23b19f92&belt=utility&hat=chinese_farmer&hatColor=%23b19f92&glasses=round&shoes=loafers&tie=neck&tieColor=%23b19f92',
CodedCharacterSet: 'UTF8',
EnvelopeRecordVersion: 4,
ImageSize: '1000x1000',
Megapixels: 1
} Voici l'exemple png: |
One more thing: webp format (supports non-lossy compression, à la png) works with sharp and it also supports exif metadata. It's probably the best option, if we wish to change image format. |
What do you think Fred? Best to stick with PNG and SVG?
Pablo Saxtron, Operations
The Character Creator
https://charactercreator.org/
…On Sat, Apr 9, 2022 at 3:27 PM Robin Millette ***@***.***> wrote:
One more thing: *webp* format (supports non-lossy compression, à la png)
works with sharp and it also supports exif metadata. It's probably the best
option, if we wish to change image format.
—
Reply to this email directly, view it on GitHub
<#212 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATC4DBPZZZZMTCMKHHZDKE3VEHK3NANCNFSM5S5FYFVA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This way, users can redraw/modify their character from a downloaded image.
The text was updated successfully, but these errors were encountered: