Skip to content

pHYs support #98

@clord

Description

@clord

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions