background bug

Welcome Forums PavillionWP background bug

This topic contains 1 reply, has 2 voices, and was last updated by Avatar Brankic1979 1 year, 11 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #6899

    If I post a single column with a png image as a background, the function imagecreatefromjpeg (called on line 1158 in functions.php) crashes, because the input is not jpeg. Which makes sense, I’m just not sure why this function is being called. The image actually renders fine. Just so you know!

    • This topic was modified 1 year, 11 months ago by Avatar huhh2.

    Thank you very much for noticing this (I totally forgot about other image types besides jpg).

    We’re using this function to get brightness of the image, so in some layouts the script can choose light or dark color for the title which is in front of that image.

    To fix this crash, replace

    $img = imagecreatefromjpeg($filename);


    			if (exif_imagetype($filename) == IMAGETYPE_JPEG) $img = imagecreatefromjpeg($filename);
    			else if (exif_imagetype($filename) == IMAGETYPE_PNG) $img = imagecreatefrompng($filename);
    			else if (exif_imagetype($filename) == IMAGETYPE_GIF) $img = imagecreatefromgif($filename);

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.