You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am receiving "corrupt JPEG" errors when I POST a base64 payload to the server. The bizarre thing is that I can paste the same base64 string into a script, performing the same logic and it works just fine.
So I am stripping out data:image/jpeg;base64, before processing, then I receive this error.
PHP Warning: getimagesize(): Corrupt JPEG data: 214 extraneous bytes before marker in /H:/path/ImageResize.php on line 126
PHP Warning: getimagesize(): Corrupt JPEG data: 214 extraneous bytes before marker in /H:/path/ImageResize.php on line 126
PHP Warning: getimagesize(): Corrupt JPEG data: 7 extraneous bytes before marker in /H:/path/ImageResize.php on line 126
PHP Warning: getimagesize(): Corrupt JPEG data: 7 extraneous bytes before marker in /H:/path/ImageResize.php on line 126
PHP Warning: getimagesize(): Corrupt JPEG data: 103 extraneous bytes before marker in /H:/path/ImageResize.php on line 126
PHP Warning: getimagesize(): Corrupt JPEG data: 103 extraneous bytes before marker in /H:/path/ImageResize.php on line 126
PHP Warning: getimagesize(): Corrupt JPEG data: 327 extraneous bytes before marker in /H:/path/ImageResize.php on line 126
PHP Warning: getimagesize(): Corrupt JPEG data: 327 extraneous bytes before marker in /H:/path/ImageResize.php on line 126
PHP Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: Unsupported marker type 0x68 in /H:/path/ImageResize.php on line 179
PHP Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: Unsupported marker type 0x68 in /H:/path/ImageResize.php on line 179
PHP Warning: imagecreatefromjpeg(): "data://application/octet-stream;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wB.....9KmcrRsRJpH/9g==" is not a valid JPEG file in /H:/path/ImageResize.php on line 179
PHP Warning: imagecreatefromjpeg(): "data://application/octet-stream;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wB.....9KmcrRsRJpH/9g==" is not a valid JPEG file in /H:/path/ImageResize.php on line 179
PHP Fatal error: Uncaught TypeError: imagesx(): Argument #1 ($image) must be of type GdImage, bool given in /H:/path/ImageResize.php on line 149
PHP Fatal error: Uncaught TypeError: imagesx(): Argument #1 ($image) must be of type GdImage, bool given in /H:/path/ImageResize.php on line 149
The length of the base64 payload is the same if I copy directly into a script or if I POST it, so it isn't a truncation issue, and I have no problems creating image from a string and resizing when the base64 is pasted in. Any ideas of what could be going on?
Server stats
PHP Version 8.0.13
PHP API | 20200930
PHP Extension | 20200930
[gd]
GD Version | bundled (2.1.0 compatible)
FreeType Support | enabled
FreeType Linkage | with freetype
FreeType Version | 2.9.1
GIF Read Support | enabled
GIF Create Support | enabled
JPEG Support | enabled
libJPEG Version | 9 compatible
PNG Support | enabled
libPNG Version | 1.6.34
WBMP Support | enabled
XPM Support | enabled
libXpm Version | 30512
XBM Support | enabled
WebP Support | enabled
BMP Support | enabled
TGA Read Support | enabled
The text was updated successfully, but these errors were encountered:
It seems to be the internal PHP error and it's same as this bug.
According to the error log, the getimagesize cannot identify your encoded string and the imagecreatefromjpeg function cannot create the correct binary image resource with specific argument.
I am receiving "corrupt JPEG" errors when I POST a base64 payload to the server. The bizarre thing is that I can paste the same base64 string into a script, performing the same logic and it works just fine.
Here is my code:
So I am stripping out
data:image/jpeg;base64,
before processing, then I receive this error.The length of the base64 payload is the same if I copy directly into a script or if I POST it, so it isn't a truncation issue, and I have no problems creating image from a string and resizing when the base64 is pasted in. Any ideas of what could be going on?
Server stats
The text was updated successfully, but these errors were encountered: