Skip to content

support BITMAPV5HEADER in getimagesize() - #249

Closed
AsamK wants to merge 1 commit into
php:masterfrom
AsamK:master
Closed

AsamK wants to merge 1 commit into
php:masterfrom
AsamK:master

Conversation

@AsamK

@AsamK AsamK commented Dec 30, 2012

Copy link
Copy Markdown

the php function getimagesize() doesn't support Bitmaps with ICC color profiles (BITMAPV5HEADER).
The size information is at the same position as Bitmaps with a BITMAPV4HEADER, so just adding a check for the different header size should be enough
https://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.28bitmap_information_header.29

@lstrojny

lstrojny commented Jan 1, 2013

Copy link
Copy Markdown
Contributor

Thanks for your PR. Please add a Testcase for the addition.

@weltling

weltling commented Jan 8, 2013

Copy link
Copy Markdown
Contributor

@AsamK you should also fix ext\standard\tests\image\image_type_to_mime_type.phpt as it picks up your new image file. Then it should be fine i'd say.

@lstrojny

Copy link
Copy Markdown
Contributor

@AsamK could you squash your commits, I’ll merge than.

https://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.28bitmap_information_header.29

added test image:
ext/standard/tests/image/test1bpix.bmp

and adapted tests:
ext/standard/tests/image/getimagesize.phpt
ext/standard/tests/image/image_type_to_mime_type
@AsamK

AsamK commented Jan 14, 2013

Copy link
Copy Markdown
Author

I squashed them.
I hope I did it correctly, this is my first pull request on github.

@lstrojny

Copy link
Copy Markdown
Contributor

Looks good! I’ll try to merge them now.

@php-pulls

Copy link
Copy Markdown

Comment on behalf of lstrojny at php.net:

Merged into 5.4, 5.5 and master. Thanks!

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

Successfully merging this pull request may close these issues.

4 participants