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

pcx: force reading header by little endian #16

Merged
merged 2 commits into from Aug 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.markdown
Expand Up @@ -2,6 +2,8 @@

## unreleased

* Fix for pcx on big endian systems by forcing reading dimensions in little endian byte order [#15](https://github.com/toy/image_size/issues/15) [#16](https://github.com/toy/image_size/pull/16) [@mtasaka](https://github.com/mtasaka)

## v2.1.1 (2021-07-04)

* Add actual license texts, assuming old dual Ruby/GPLv2 license [#14](https://github.com/toy/image_size/issues/14) [@toy](https://github.com/toy)
Expand Down
2 changes: 1 addition & 1 deletion lib/image_size.rb
Expand Up @@ -294,7 +294,7 @@ def size_of_tiff(ir)
end

def size_of_pcx(ir)
parts = ir[4, 8].unpack('S4')
parts = ir[4, 8].unpack('v4')
[parts[2] - parts[0] + 1, parts[3] - parts[1] + 1]
end

Expand Down