IPrice minimart
powerfull & flexible online Store, price-lists and catalogs for Joomla
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Warning: getimagesize error problem

Warning: getimagesize error problem 8 years 6 months ago #2885

  • vdneut
  • vdneut's Avatar
  • Offline
  • Новый участник
  • Posts: 1
  • Karma: 0
Had same problem with J3 and Smartresizer in combination with the Attachement plugin.
It tries to find some icon gif file in media directory and the getimagesize function gives a warning it can not find the stream (file).

I'm more pragmatic... so, if getimagesize() gives a warning, just make sure it does not happen in such cases.
Therefore add the following two lines just before the getimagesize() function:
if (!file_exists($src))
	continue;

Did it for me.
Last Edit: 8 years 6 months ago by vdneut.
Login or register to post message.

Warning: getimagesize error problem 8 years 3 months ago #3020

  • MTSranger
  • MTSranger's Avatar
  • Offline
  • Новый участник
  • Posts: 2
  • Karma: 0
This is a bug. The code does not use full path when calling getimagesize() - it uses the text in the src attribute of the img tag which if it is an absolute path would be the wrong one. One cheap fix is the following:

Modify line 370 of smartresizer.php from
preg_match( "#src=\"(.*?)\"#si", $inline_params, $src );
to
preg_match( "#src=\"/?(.*?)\"#si", $inline_params, $src );

This works by stripping the leading slash from the src attribute to change it to relative path. I think under Joomla, when the php file is run, relative paths are relative to the site root.

I would also second suggestion by vdneut (1 post above) in addition to the above fix, because we do not want non-existent images to reveal information about the server.
Last Edit: 8 years 3 months ago by MTSranger.
Login or register to post message.
  • Page:
  • 1
  • 2
Moderators: support

Subscribe



Subscribe to our newsletter and social networks to be updated with the latest updates.

Login