Loading...
 
Skip to main content

Thumbnail generation crashes on SVG if not uploaded by admin

Status
Open
Subject
Thumbnail generation crashes on SVG if not uploaded by admin
Version
18.x
Category
  • Bug
  • Easy for Newbie Dev
Feature
File Gallery (elFinder or standard UI)
Resolution status
New
Submitted by
hman
Lastmod by
hman
Rating
(0)
Related-to
Description

SVG uploading can be blocked by admin, because there are certain security risks with them. But Tiki file galleries have a different problem with them. When admin uploads a SVG, a default thumbnail for the MIME type image/svg+xml is displayed (instead of the embedded thumbnail!). That's not optimal, but at least it works.

When a user uploads a SVG, something else happens: Thumbnail generation crashes. Instead of the default thumbnail a tiny error message is displayed in a window the size of the thumbnail. It reads:

Copy to clipboard
Warning: imagecreatefromstring(): Data is not in a recognized format in MYHOME/htdocs/tiki-18.8/lib/images/gd.php on line 70 Warning: Cannot modify header information - headers already sent by (output started at MYHOME/tiki-18.8/lib/images/gd.php:70) in MYHOME/tiki-18.8/tiki-download_file.php on line 395 Warning: Cannot modify header information - headers already sent by (output started at MYHOME/tiki-18.8/lib/images/gd.php:70) in MYHOME/tiki-18.8/tiki-download_file.php on line 404 Warning: Cannot modify header information - headers already sent by (output started at MYHOME/tiki-18.8/lib/images/gd.php:70) in MYHOME/tiki-18.8/tiki-download_file.php on line 442


After that, something that looks like the header of the thumbnail follows

Copy to clipboard
�PNG ((0000)) IHDR}�((0008))((0003))


and after that LOTS of binary garbage, possibly the entire rest of the file...

My Linux desktop (Linux Mint 19.3) a.k.a. Ubuntu Bionic Beaver with Cinnamon as desktop does display the embedded thumbnail. I'll have to figure out which binary compiles the thumbnails for image/svg+xml (does not have to be the same that is used for JPEG, PNG etc.).

Importance
7
Easy to solve?
10 easy
Priority
70
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
8112
Created
Thursday 03 March, 2022 08:17:02 UTC
by hman
LastModif
Thursday 03 March, 2022 08:21:26 UTC


Show PHP error messages