Search the Community
Showing results for tags 'content-type'.
Found 1 result
-
Boa tarde, estou usando esse código para fazer com que as imagens carreguem mais rápido, porém só funciona com JPG, gostaria que funcionasse também com PNG, se alguém puder me ajudar agradeço. Segue o código abaixo: <?php // The file $qualita = $_REQUEST['q']; if(!$qualita) { $qualita = 1; } $filename = $_GET['img']; $prop = $_REQUEST['scala']; if(!$prop) { $prop = 1; } // Set a maximum height and width // Content type header('Content-Type: image/jpeg'); // Get new dimensions list($width_orig, $height_orig) = getimagesize($filename); //$width = $prop*621; //$height = $prop*502; $width = 1000; $height = 667; //maantem ration $ratio_orig = $width_orig/$height_orig; if ($width/$height > $ratio_orig) { $width = $height*$ratio_orig; } else { $height = $width/$ratio_orig; } // Resample $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width_orig*$prop, $height_orig*$prop, $width_orig, $height_orig); // Output imagejpeg($image_p, null, 100); ?>
- 2 replies
-
- content-type
- image/png
- (and 8 more)