It would be nice to have api support for generating the pHYs section, as it is part of the PNG Specification.
It's possible to do it manually if there is already a chunk:
stream.each_chunk do |c|
if c.type == 'pHYs'
c.content = [5906, 5906, 1] .pack('N2C')
end
end
But it's not as easy to insert this node into a fresh PNG. I plan on inserting a ChunkyPNG::Chunk::Generic into #other_chunks, but this feels really a tad dirty. I propose that Datastream have ChunkyPNG::Chunk::Phys and a corresponding phys_chunk accessor.
It would be nice to have api support for generating the pHYs section, as it is part of the PNG Specification.
It's possible to do it manually if there is already a chunk:
But it's not as easy to insert this node into a fresh PNG. I plan on inserting a
ChunkyPNG::Chunk::Generic
into#other_chunks
, but this feels really a tad dirty. I propose thatDatastream
haveChunkyPNG::Chunk::Phys
and a correspondingphys_chunk
accessor.