Skip to content
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

pHYs support #98

Open
clord opened this issue Aug 14, 2015 · 1 comment
Open

pHYs support #98

clord opened this issue Aug 14, 2015 · 1 comment

Comments

@clord
Copy link

clord commented Aug 14, 2015

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.

@wvanbergen
Copy link
Owner

👍 this would be a nice addition.

It's unlikely I will have time to work on this anytime soon though, but feel free to ask me to help if you are willing to take a stab at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants