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

SVG image issue #4

Open
alkachur opened this issue Mar 12, 2024 · 6 comments
Open

SVG image issue #4

alkachur opened this issue Mar 12, 2024 · 6 comments
Labels
type: bug 🐛 Is a bug; fixes a bug

Comments

@alkachur
Copy link

If for some reason one of the images will be in SVG format it will break the site with a 500 error.
I think it should be some internal function of the plugin that will check formats, and if the format is SVG or some format that the plugin couldn't work with to not do thumb at all. It's better than ruining all site.

@tobimori tobimori added the type: bug 🐛 Is a bug; fixes a bug label Mar 12, 2024
@foxacid
Copy link

foxacid commented May 15, 2024

👀 This just happened to us with AVIF

@samlinck
Copy link

I think I have the same issue:

Illuminate\View\ViewException thrown with message "imagecreatefromstring(): Data is not in a recognized format (View: /var/www/html/site/plugins/artomic/ui/02_atoms/visual/visual.blade.php) (View: /var/www/html/site/plugins/artomic/ui/02_atoms/visual/visual.blade.php) (View: /var/www/html/site/plugins/artomic/ui/02_atoms/visual/visual.blade.php) (View: /var/www/html/site/plugins/artomic/ui/02_atoms/visual/visual.blade.php)"

Stacktrace:
#53 Illuminate\View\ViewException in /var/www/html/site/plugins/kirby-thumbhash/classes/ThumbHash.php:50
#52 Illuminate\View\Engines\CompilerEngine:handleViewException in /var/www/html/vendor/illuminate/view/Engines/PhpEngine.php:60
#51 Illuminate\View\ViewException in /var/www/html/site/plugins/kirby-thumbhash/classes/ThumbHash.php:50
#50 Illuminate\View\Engines\CompilerEngine:handleViewException in /var/www/html/vendor/illuminate/view/Engines/PhpEngine.php:60
#49 Illuminate\View\ViewException in /var/www/html/site/plugins/kirby-thumbhash/classes/ThumbHash.php:50
#48 Illuminate\View\Engines\CompilerEngine:handleViewException in /var/www/html/vendor/illuminate/view/Engines/PhpEngine.php:60
#47 Illuminate\View\ViewException in /var/www/html/site/plugins/kirby-thumbhash/classes/ThumbHash.php:50
#46 Illuminate\View\Engines\CompilerEngine:handleViewException in /var/www/html/vendor/illuminate/view/Engines/PhpEngine.php:60
#45 Whoops\Exception\ErrorException in /var/www/html/site/plugins/kirby-thumbhash/classes/ThumbHash.php:50
#44 imagecreatefromstring in /var/www/html/site/plugins/kirby-thumbhash/classes/ThumbHash.php:50
#43 tobimori\ThumbHash:encode in /var/www/html/site/plugins/kirby-thumbhash/index.php:11
#42 Kirby\Cms\File:{closure} in [internal]:0
#41 Closure:call in /var/www/html/kirby/src/Cms/HasMethods.php:39
#40 Kirby\Cms\File:callMethod in /var/www/html/kirby/src/Cms/File.php:115
#39 Kirby\Cms\File:__call in /var/www/html/storage/cache/views/6de4dfe08bb1618102e8922797fc0d5a.php:44
#38 require in /var/www/html/vendor/illuminate/filesystem/Filesystem.php:123
#37 Illuminate\Filesystem\Filesystem:Illuminate\Filesystem\{closure} in /var/www/html/vendor/illuminate/filesystem/Filesystem.php:124
#36 Illuminate\Filesystem\Filesystem:getRequire in /var/www/html/vendor/illuminate/view/Engines/PhpEngine.php:58
#35 Illuminate\View\Engines\PhpEngine:evaluatePath in /var/www/html/vendor/illuminate/view/Engines/CompilerEngine.php:72
#34 Illuminate\View\Engines\CompilerEngine:get in /var/www/html/vendor/illuminate/view/View.php:207
#33 Illuminate\View\View:getContents in /var/www/html/vendor/illuminate/view/View.php:190
#32 Illuminate\View\View:renderContents in /var/www/html/vendor/illuminate/view/View.php:159
#31 Illuminate\View\View:render in /var/www/html/vendor/illuminate/view/Concerns/ManagesComponents.php:103
#30 Illuminate\View\Factory:renderComponent in /var/www/html/storage/cache/views/f9879868b25098368ee9c78677ec5620.php:46
#29 require in /var/www/html/vendor/illuminate/filesystem/Filesystem.php:123
#28 Illuminate\Filesystem\Filesystem:Illuminate\Filesystem\{closure} in /var/www/html/vendor/illuminate/filesystem/Filesystem.php:124
#27 Illuminate\Filesystem\Filesystem:getRequire in /var/www/html/vendor/illuminate/view/Engines/PhpEngine.php:58
#26 Illuminate\View\Engines\PhpEngine:evaluatePath in /var/www/html/vendor/illuminate/view/Engines/CompilerEngine.php:72
#25 Illuminate\View\Engines\CompilerEngine:get in /var/www/html/vendor/illuminate/view/View.php:207
#24 Illuminate\View\View:getContents in /var/www/html/vendor/illuminate/view/View.php:190
#23 Illuminate\View\View:renderContents in /var/www/html/vendor/illuminate/view/View.php:159
#22 Illuminate\View\View:render in /var/www/html/vendor/illuminate/view/Concerns/ManagesComponents.php:103
#21 Illuminate\View\Factory:renderComponent in /var/www/html/storage/cache/views/58dbacd45024730a45d1db4b61211054.php:28
#20 require in /var/www/html/vendor/illuminate/filesystem/Filesystem.php:123
#19 Illuminate\Filesystem\Filesystem:Illuminate\Filesystem\{closure} in /var/www/html/vendor/illuminate/filesystem/Filesystem.php:124
#18 Illuminate\Filesystem\Filesystem:getRequire in /var/www/html/vendor/illuminate/view/Engines/PhpEngine.php:58
#17 Illuminate\View\Engines\PhpEngine:evaluatePath in /var/www/html/vendor/illuminate/view/Engines/CompilerEngine.php:72
#16 Illuminate\View\Engines\CompilerEngine:get in /var/www/html/vendor/illuminate/view/View.php:207
#15 Illuminate\View\View:getContents in /var/www/html/vendor/illuminate/view/View.php:190
#14 Illuminate\View\View:renderContents in /var/www/html/vendor/illuminate/view/View.php:159
#13 Illuminate\View\View:render in /var/www/html/vendor/illuminate/view/Concerns/ManagesComponents.php:103
#12 Illuminate\View\Factory:renderComponent in /var/www/html/storage/cache/views/106c6d7316ab9785cb7733d86c2df50b.php:47
#11 require in /var/www/html/vendor/illuminate/filesystem/Filesystem.php:123
#10 Illuminate\Filesystem\Filesystem:Illuminate\Filesystem\{closure} in /var/www/html/vendor/illuminate/filesystem/Filesystem.php:124
#9 Illuminate\Filesystem\Filesystem:getRequire in /var/www/html/vendor/illuminate/view/Engines/PhpEngine.php:58
#8 Illuminate\View\Engines\PhpEngine:evaluatePath in /var/www/html/vendor/illuminate/view/Engines/CompilerEngine.php:72
#7 Illuminate\View\Engines\CompilerEngine:get in /var/www/html/vendor/illuminate/view/View.php:207
#6 Illuminate\View\View:getContents in /var/www/html/vendor/illuminate/view/View.php:190
#5 Illuminate\View\View:renderContents in /var/www/html/vendor/illuminate/view/View.php:159
#4 Illuminate\View\View:render in /var/www/html/site/plugins/artomic/src/Template.php:40
#3 Artcoresociety\Artomic\Template:render in /var/www/html/kirby/src/Cms/Page.php:1017
#2 Kirby\Cms\Page:render in /var/www/html/kirby/src/Cms/App.php:775
#1 Kirby\Cms\App:io in /var/www/html/kirby/src/Cms/App.php:1189
#0 Kirby\Cms\App:render in /var/www/html/public/index.php:23

@tobimori
Copy link
Owner

If it happens with AVIF, your PHP version is most likely not compiled/not supported to support AVIF.

@samlinck
Copy link

I just checked and if I only load the svg without avif or webp sources, it still happens. So I think it's something related with SVG and thumbhash.

@tobimori
Copy link
Owner

I know. But in this case, please add your own check.

@samlinck
Copy link

Okay, that was my current solution. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

No branches or pull requests

4 participants