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

Images corrupted error: <img id="e1d07cd1-8752cc2f-641b182c5d55f2.10433112" src="data:image/png;base64,iVBORw0KGgoAAAA #14379

Closed
2 tasks done
SilvaFernando opened this issue Mar 23, 2023 · 4 comments

Comments

@SilvaFernando
Copy link

SilvaFernando commented Mar 23, 2023

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

10.0.6

Bug description

Images on tickets and followups are corrupted:
image

And when i try send notification i have this error:
image

Relevant log output

In logs:
==> php-errors.log <==
[2023-03-23 19:56:22] glpiphplog.WARNING:   *** PHP Warning (2): imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: Invalid JPEG file structure: two SOI markers in /usr/share/glpi/src/Toolbox.php at line 1066
  Backtrace :
  src/Toolbox.php:1066                               imagecreatefromjpeg()
  src/Document.php:1849                              Toolbox::resizePicture()
  src/NotificationEventMailing.php:461               Document::getImage()
  src/NotificationEventMailing.php:335               NotificationEventMailing::attachDocuments()
  src/QueuedNotification.php:476                     NotificationEventMailing::send()
  src/QueuedNotification.php:116                     QueuedNotification->sendById()
  src/MassiveAction.php:1408                         QueuedNotification::processMassiveActionsForOneItemtype()
  src/MassiveAction.php:1386                         MassiveAction->processForSeveralItemtypes()
  front/massiveaction.php:59                         MassiveAction->process()

[2023-03-23 19:56:22] glpiphplog.WARNING:   *** PHP Warning (2): imagecreatefromjpeg(): &quot;/var/lib/glpi/files/_documents/JPG/cf/f5508f06cdb38cdc2dbbe8e04dde0a1a508388.JPG&quot; is not a valid JPEG file in /usr/share/glpi/src/Toolbox.php at line 1066
  Backtrace :
  src/Toolbox.php:1066                               imagecreatefromjpeg()
  src/Document.php:1849                              Toolbox::resizePicture()
  src/NotificationEventMailing.php:461               Document::getImage()
  src/NotificationEventMailing.php:335               NotificationEventMailing::attachDocuments()
  src/QueuedNotification.php:476                     NotificationEventMailing::send()
  src/QueuedNotification.php:116                     QueuedNotification->sendById()
  src/MassiveAction.php:1408                         QueuedNotification::processMassiveActionsForOneItemtype()
  src/MassiveAction.php:1386                         MassiveAction->processForSeveralItemtypes()
  front/massiveaction.php:59                         MassiveAction->process()

[2023-03-23 19:56:22] glpiphplog.CRITICAL:   *** Uncaught Exception TypeError: imagecopyresampled(): Argument #2 ($src_image) must be of type GdImage, bool given in /usr/share/glpi/src/Toolbox.php at line 1098
  Backtrace :
  src/Toolbox.php:1098                               imagecopyresampled()
  src/Document.php:1849                              Toolbox::resizePicture()
  src/NotificationEventMailing.php:461               Document::getImage()
  src/NotificationEventMailing.php:335               NotificationEventMailing::attachDocuments()
  src/QueuedNotification.php:476                     NotificationEventMailing::send()
  src/QueuedNotification.php:116                     QueuedNotification->sendById()
  src/MassiveAction.php:1408                         QueuedNotification::processMassiveActionsForOneItemtype()
  src/MassiveAction.php:1386                         MassiveAction->processForSeveralItemtypes()
  front/massiveaction.php:59                         MassiveAction->process()

Page URL

/front/massiveaction.php

Steps To reproduce

Add a image JPEG on GLPI, my file have 735kb

Your GLPI setup information

Operating system: Linux 60113dba5e2c 4.18.0-348.20.1.el8_5.x86_64 #1 SMP Thu Mar 10 20:59:28 UTC 2022 x86_64
PHP 8.0.27 fpm-fcgi (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apcu, bz2, calendar, cgi-fcgi, ctype, curl,
date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd,
openssl, pcre, pdo_mysql, pdo_sqlite, posix, selinux, session, shmop, snmp, soap, sockets, sodium, sqlite3, standard, sysvmsg,
sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="30" memory_limit="-1" post_max_size="20M" safe_mode="" session.save_handler="files"
upload_max_filesize="20M"
Software: Apache/2.4.37 (AlmaLinux) ()
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.51
Server Software: Percona Server (GPL), Release 42, Revision b0a7dc2da2e
Server Version: 5.7.39-42
Server SQL Mode: STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Parameters: glpi@172.17.0.4/glpi
Host info: 172.17.0.4 via TCP/IP

PHP version (8.0.27) is supported.PHP version (8.0.27) is supported.
Sessions configuration is OK.Sessions configuration is OK.
Allocated memory is unlimited.Allocated memory is unlimited.
mysqli extension is installed.mysqli extension is installed.
Following extensions are installed: dom, fileinfo, json, simplexml.Following extensions are installed: dom, fileinfo, json, simplexml.
curl extension is installed.curl extension is installed.
gd extension is installed.gd extension is installed.
intl extension is installed.intl extension is installed.
libxml extension is installed.libxml extension is installed.
zlib extension is installed.zlib extension is installed.
The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.
Database engine version (5.7.39) is supported.Database engine version (5.7.39) is supported.
No files from previous GLPI version detected.No files from previous GLPI version detected.
The log file has been created successfully.The log file has been created successfully.
Write access to /var/lib/glpi/files/_cache has been validated. The directory could not be created in /etc/glpi. Write access to /var/lib/glpi/files/_cron has been validated. Write access to /var/lib/glpi/files/data-documents has been validated. Write access to /var/lib/glpi/files/_dumps has been validated. Write access to /var/lib/glpi/files/_graphs has been validated. Write access to /var/lib/glpi/files/_lock has been validated. Write access to /var/lib/glpi/files/_pictures has been validated. Write access to /var/lib/glpi/files/_plugins has been validated. Write access to /var/lib/glpi/files/_rss has been validated. Write access to /var/lib/glpi/files/_sessions has been validated. Write access to /var/lib/glpi/files/_tmp has been validated. Write access to /var/lib/glpi/files/_uploads has been validated.Write access to /var/lib/glpi/files/_cache has been validated.
The directory could not be created in /etc/glpi.
Write access to /var/lib/glpi/files/_cron has been validated.
Write access to /var/lib/glpi/files/data-documents has been validated.
Write access to /var/lib/glpi/files/_dumps has been validated.
Write access to /var/lib/glpi/files/_graphs has been validated.
Write access to /var/lib/glpi/files/_lock has been validated.
Write access to /var/lib/glpi/files/_pictures has been validated.
Write access to /var/lib/glpi/files/_plugins has been validated.
Write access to /var/lib/glpi/files/_rss has been validated.
Write access to /var/lib/glpi/files/_sessions has been validated.
Write access to /var/lib/glpi/files/_tmp has been validated.
Write access to /var/lib/glpi/files/_uploads has been validated.
GLPI data directories are located in a secured path.GLPI data directories are located in a secured path.
For security reasons, SELinux mode should be Enforcing.For security reasons, SELinux mode should be Enforcing.
PHP directive "session.cookie_httponly" should be set to "on" to prevent client-side script to access cookie values.PHP directive "session.cookie_httponly" should be set to "on" to prevent client-side script to access cookie values.
exif extension is installed.exif extension is installed.
ldap extension is installed.ldap extension is installed.
openssl extension is installed.openssl extension is installed.
zip extension is installed.zip extension is installed.
bz2 extension is installed.bz2 extension is installed.
Zend OPcache extension is installed.Zend OPcache extension is installed.
Following extensions are installed: ctype, iconv, mbstring, sodium.Following extensions are installed: ctype, iconv, mbstring, sodium.
Write access to /usr/share/glpi/marketplace has been validated.Write access to /usr/share/glpi/marketplace has been validated.
Access to timezone database (mysql) is not allowed.Access to timezone database (mysql) is not allowed.

Anything else?

No response

@trasher
Copy link
Contributor

trasher commented Mar 23, 2023

JPEG library reports unrecoverable error: Invalid JPEG file structure: two SOI markers => seems like an issue with your image. Please provide example image so e can try to reorpdice (or fix images if there is really a problem with it).

@SilvaFernando
Copy link
Author

Hi @trasher.

This issue happens when i have A JPEG better than 720kb, if i use a PNG format or a small image, i don't have this issue

BR.
Fernando Dias da Silva

@cedric-anne
Copy link
Member

Please attach the corresponding file.

@cedric-anne
Copy link
Member

It seems that there is a mix of multiple issues here.

Problem with big images may be the same as reported in #13606. Try to increase pcre.backtrack_limit PHP configuration value.

@cedric-anne cedric-anne closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants