povray icon indicating copy to clipboard operation
povray copied to clipboard

EXIF now supported by PNG group.

Open mjhorvath opened this issue 7 years ago • 7 comments

Summary

EXIF metadata now supported by PNG group.

Suggested Solution

According to changes to the PNG specification (http://ftp-osl.osuosl.org/pub/libpng/documents/pngext-1.5.0.html#C.eXIf), the PNG format now supports EXIF data. It would be great to be able to save some comments/metadata to these chunks via SDL commands.

mjhorvath avatar Feb 23 '18 03:02 mjhorvath

Currently, the metadata written in generated image is, for png, when the libpng supports writing text:

  • Render Date
  • Software
  • Comment, made of up to 4 lines

According to compilation option (METADATA_PLATFORM_STRING, METADATA_COMPILER_STRING, METADATA_COMMENT_3 and METADATA_COMMENT_4), the lines (at most 80 characters each, ascii, no formatting)

  1. Platform: ...
  2. Compiler: ...
  3. empty
  4. empty

it seems possible to assign some usage for line 3 & 4, but it need more specifications.

Please keep in mind that the metadata are also put in the other output file formats (when supported), hence the limitation to have at most 80 ascii-characters per line, without control char (because some format enforce a maximal length of 80, and some want only readable text without even a line feed or a tab)

LeForgeron avatar Apr 08 '18 20:04 LeForgeron

Hi, the crazy idea is to workout new combo format, including world readable raster image (whatever container - JPEG, PNG, or so, ) and full POVRay scene. Thus, having such a file would made easier building of editable galleries, by simple picking up interesting scene, editing it in dedicated editor (eg. POVRay) and then render back to gallery image. BR, Janusz

JustJanush avatar Jun 29 '18 19:06 JustJanush

Should it go in the Povray Scene or in the INI file ? If you intend to re-render after update, you would enjoy an ini file (for the resolution and other settings)

Remember, for compatibility with the various image formats, you only, at most, have 2 sequences of at most 80 ascii characters still available.

And it is not obvious: If you want to edit the metadata from an already rendered scene, it is simpler to use a graphical 2D editor, or exiftool directly. (compared to the few hours a render might take)

I do not understand the combo format, what do you have in mind ?

LeForgeron avatar Jun 29 '18 20:06 LeForgeron

I am not sure about POV or INI, maybe both? Combo format - 2in1: I mean something similar to video container where audio and video streams are mixed together, or TIFF file with preview thumbnail. For example: [[image_data.png][SDL file]] or [[image_data.png][INI file][SDL POV file]] . The hardest task is to keep it readable by popular graphics viewers like Irfan or XnView. BR.

JustJanush avatar Jun 29 '18 21:06 JustJanush

If you are taking about the content of the comment, it's rather irrelevant, as the original request is it would be great to be able to save some comments/metadata to these chunks via SDL commands.

Which means to me that the user (or creator of the scene) is actually in charge of that content.

Hereafter a summary of the current state:

current meta data

BMP

None (no place in the format)

TGA

exiftool does not recognize the format, but comments can be retrieved with strings

Platform: x86_64-pc-linux-gnu Compiler: icpc 18.0.3 POV-Ray v3.8.0-alpha.unofficial TRUEVISION-XFILE.

EXR

exiftool is fine

exifTool Version Number : 10.80 File Name : metaexr.exr Directory : . File Size : 4.6 kB File Modification Date/Time : 2018:06:30 11:42:39+02:00 File Access Date/Time : 2018:06:30 11:46:34+02:00 File Inode Change Date/Time : 2018:06:30 11:42:39+02:00 File Permissions : rw-rw-r-- File Type : EXR File Type Extension : exr MIME Type : image/x-exr EXR Version : 2 Layout : Scan Lines Channels : B half 1 1, G half 1 1, R half 1 1 Comments : Platform: x86_64-pc-linux-gnu.Compiler: icpc 18.0.3. Compression : ZIP Creation : 2018-06-30 09:42:39Z Data Window : 0 0 799 599 Display Window : 0 0 799 599 Line Order : Increasing Y Pixel Aspect Ratio : 1 Screen Window Center : 0 0 Screen Window Width : 1 Software : POV-Ray v3.8.0-alpha.unofficial Image Width : 800 Image Height : 600 Image Size : 800x600 Megapixels : 0.480

hdr

exiftool is confused by having two comment entries, yet xnview is fine. hdrmeta

ExifTool Version Number : 10.80 File Name : metahdr.hdr Directory : . File Size : 35 kB File Modification Date/Time : 2018:06:30 11:42:39+02:00 File Access Date/Time : 2018:06:30 11:46:34+02:00 File Inode Change Date/Time : 2018:06:30 11:42:39+02:00 File Permissions : rw-rw-r-- File Type : HDR File Type Extension : hdr MIME Type : image/vnd.radiance Software : POV-Ray v3.8.0-alpha.unofficial Creation time : 2018-06-30 09:42:39Z Comment : Compiler: icpc 18.0.3 Format : 32-bit_rle_rgbe Orientation : Horizontal (normal) Image Height : 600 Image Width : 800 Image Size : 800x600 Megapixels : 0.480

jpg

exiftool is fine

ExifTool Version Number : 10.80 File Name : metajpg.jpg Directory : . File Size : 14 kB File Modification Date/Time : 2018:06:30 11:42:40+02:00 File Access Date/Time : 2018:06:30 11:42:55+02:00 File Inode Change Date/Time : 2018:06:30 11:42:40+02:00 File Permissions : rw-rw-r-- File Type : JPEG File Type Extension : jpg MIME Type : image/jpeg JFIF Version : 1.01 Resolution Unit : None X Resolution : 1 Y Resolution : 1 Comment : Render Date: 2018-06-30 09:42:40Z.Software: POV-Ray v3.8.0-alpha.unofficial.Platform: x86_64-pc-linux-gnu.Compiler: icpc 18.0.3. Image Width : 800 Image Height : 600 Encoding Process : Baseline DCT, Huffman coding Bits Per Sample : 8 Color Components : 3 Y Cb Cr Sub Sampling : YCbCr4:4:4 (1 1) Image Size : 800x600 Megapixels : 0.480

png

exiftool is fine

ExifTool Version Number : 10.80 File Name : metapng.png Directory : . File Size : 1697 bytes File Modification Date/Time : 2018:06:30 11:42:41+02:00 File Access Date/Time : 2018:06:30 11:42:55+02:00 File Inode Change Date/Time : 2018:06:30 11:42:41+02:00 File Permissions : rw-rw-r-- File Type : PNG File Type Extension : png MIME Type : image/png Image Width : 800 Image Height : 600 Bit Depth : 8 Color Type : RGB Compression : Deflate/Inflate Filter : Adaptive Interlace : Noninterlaced Gamma : 2.2 SRGB Rendering : Perceptual Significant Bits : 8 8 8 Modify Date : 2018:06:30 09:42:41 Software : POV-Ray v3.8.0-alpha.unofficial Comment : Render Date: 2018-06-30 09:42:41Z.Platform: x86_64-pc-linux-gnu.Compiler: icpc 18.0.3. Image Size : 800x600 Megapixels : 0.480

ppm

exiftool is fine, but rather useless as the comments are in the header part, in clear text

P6 # Software: POV-Ray v3.8.0-alpha.unofficial # Render Date: 2018-06-30 09:42:42Z # Platform: x86_64-pc-linux-gnu # Compiler: icpc 18.0.3 800 600

LeForgeron avatar Jun 30 '18 10:06 LeForgeron

In fact my comment means new functionality, so it is rather parallel to this discussion. Turning back to EXIF/PNG. For me very important is saving of the command line for possible future re-render. I absolutely support your idea. BR.

JustJanush avatar Jun 30 '18 12:06 JustJanush

Let diverge your request in a new issue if you dare:

  • the saving of the full setting for a render is done via +GIfilename option
    • It is kind of smart, it only save non-default values, IIRC
  • the full setting is too large to fit a 80 characters line.
  • you seem to need something like a directory system (in which you put the picture, the scene and its ini)
    • it could be anything similar, like an archive or a fork/resource based filesystem a la windows (stay away of that), but the more far away it is from a directory per image, the more specific to your situation it become

Back to the original issue, so far we are missing actual specifications about the wanted feature. All I have is the restriction that it should be 1 or 2 lines of at most 80 characters.

  • we could specify to truncate when image does not support longer line
  • or we could specify to reject any longer line, whatever the output format.
  1. Do we add an header ? (such as Keyword:, wasting some place)
  2. Do we allocate the usage of one or two lines ? (and what would each be named ?)
  3. Do we allow to set the value from ini ?
  4. Do we allow to add text ? (or must it be set at once ?)
  5. Do we allow access to the value from SDL ? (to retrieve the value for something else)

LeForgeron avatar Jul 02 '18 12:07 LeForgeron