Last active
December 11, 2015 14:18
-
-
Save zaigham/4612852 to your computer and use it in GitHub Desktop.
Hack to stop Chrome from downloading phpthumb images on every transition in slider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// AROUND LINE 3909 in phpthumb.class.php: added >>>> header('Cache-Control:'); <<<< to the logic. | |
if (function_exists('ImageTypes')) { | |
$imagetypes = ImageTypes(); | |
if ($imagetypes & IMG_PNG) { | |
header('Content-Type: image/png'); | |
header('Cache-Control:'); | |
ImagePNG($gdimg_error); | |
} elseif ($imagetypes & IMG_GIF) { | |
header('Content-Type: image/gif'); | |
header('Cache-Control:'); | |
ImageGIF($gdimg_error); | |
} elseif ($imagetypes & IMG_JPG) { | |
header('Content-Type: image/jpeg'); | |
header('Cache-Control:'); | |
ImageJPEG($gdimg_error); | |
} elseif ($imagetypes & IMG_WBMP) { | |
header('Content-Type: image/vnd.wap.wbmp'); | |
header('Cache-Control:'); | |
ImageWBMP($gdimg_error); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment