laminas / laminas-diactoros

PSR HTTP Message implementations
https://docs.laminas.dev/laminas-diactoros/
BSD 3-Clause "New" or "Revised" License
483 stars 63 forks source link

ImageStream implementation #147

Closed weierophinney closed 1 year ago

weierophinney commented 1 year ago
Q A
Documentation no
Bugfix yes
BC Break future
New Feature yes
RFC no
QA no

Description

Per discussion in #57, this patch does the following:

The plan will be for 3.0.0 to remove support for GdImage from Stream.

boesing commented 1 year ago

Summing up Slack discussion:

Currently, neither PHP 7.4 nor 8.0 with both resource or GdImage are properly functioning as both GdImage and the resource which are passed do not contain the image type. So should the image created as an PNG or a JPEG? Lacking this information, using stream_get_contents on the gdimage resource will result in:

Warning: stream_get_contents(): supplied resource is not a valid stream resource

For PHP 8.0 and GdImage, that error will slightly change to Warning: Uncaught TypeError: stream_get_contents(): Argument #1 ($stream) must be of type resource, GdImage given.

So the whole image feature is non-existent and therefore never worked. Won't be even a BC break by removing this feature tho.

weierophinney commented 1 year ago

Based on the Slack conversation and the feedback here, I'm going to close this patch, and then open a new one against 3.0.x to drop support for GD images in Stream.