Skip to content

Some HTML pages recognized as SVG files #1191

@jtojnar

Description

@jtojnar

Since #1152, we support SVG favicons. Reddit spout tries to use the post link as an favicon (since some subreddits share primarily images) but when the link is not an image but a HTML page, which happens to contain <svg we pass it to Imagick, leading to exception like:

ImagickException(code: 420): no decode delegate for this image format `' @ error/blob.c/BlobToImage/362 at /home/jtojnar/Projects/selfoss/src/helpers/Image.php:187)
[stacktrace]
#0 /home/jtojnar/Projects/selfoss/src/helpers/Image.php(187): Imagick->readimageblob('<!doctype html>...')
#1 /home/jtojnar/Projects/selfoss/src/helpers/Image.php(88): helpers\\Image->loadImage('https://www.dai...', 'png', NULL, NULL)
#2 /home/jtojnar/Projects/selfoss/src/spouts/reddit/reddit2.php(158): helpers\\Image->fetchFavicon('https://www.dai...')
eddit2->getIcon()Projects/selfoss/src/helpers/ContentLoader.php(224): spouts\
#4 /home/jtojnar/Projects/selfoss/src/helpers/ContentLoader.php(63): helpers\\ContentLoader->fetch(Array)
#5 /home/jtojnar/Projects/selfoss/cliupdate.php(7): helpers\\ContentLoader->update()
#6 {main}
"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions