shedokan Posted June 15, 2009 Share Posted June 15, 2009 I am trying to get an image from a file and display it, I found this script very slow: <?php header('Content-type: image/png'); $im = imagecreatefromjpeg('image.jpg'); imagepng($im); imagedestroy($im); ?> is there a faster way? Link to comment https://forums.phpfreaks.com/topic/162263-solved-get-image-and-display-itsomething-faster-thand-gd/ Share on other sites More sharing options...
rhodesa Posted June 15, 2009 Share Posted June 15, 2009 can it be in the native JPG format? And is there a reason it's in a PHP script? <?php header('Content-type: image/jpeg'); readfile('image.jpg'); ?> Link to comment https://forums.phpfreaks.com/topic/162263-solved-get-image-and-display-itsomething-faster-thand-gd/#findComment-856382 Share on other sites More sharing options...
shedokan Posted June 15, 2009 Author Share Posted June 15, 2009 yes, because I use images like images/1.jpg and I don't want people to be able to browse trough them. I save the image path in a session. and thanks. Link to comment https://forums.phpfreaks.com/topic/162263-solved-get-image-and-display-itsomething-faster-thand-gd/#findComment-856387 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.