note 78641 added to function.imagejpeg

From: Date: Sun, 21 Oct 2007 02:58:21 +0000
Subject: note 78641 added to function.imagejpeg
Groups: php.notes 
Request: Send a blank email to php-notes+get-131588@lists.php.net to get a copy of this message
I'm trying to simply display an image without having to recreate it. This is to block non-members from accessing fullsize images. The .htaccess file redirects "photos/image.jpg" to "download.php?p=image.jpg". Then download.php checks if they are logged in, and if they are, lets them see the fullsize image. <?php if( !$loggedin ) { // do something } else { header("Content-Type: image/jpeg"); $image = imagecreatefromjpeg("photos/".$p); imagejpeg($image,"",80); } ?> This successfully blocks non-members, and lets members see the fullsize image. However, it doesn't let them see the exact file "photos/image.jpg", instead it creates a copy with 80% quality - or 90% or 100%, whatever, the point is, it's a copy and not the original. How can I simply display the fullsize original image without creating a copy, and without getting blocked by the .htaccess file? ---- Server IP: 208.69.120.35 Probable Submitter: 66.254.246.198 ---- Manual Page -- http://www.php.net/manual/en/function.imagejpeg.php Edit -- https://master.php.net/note/edit/78641 Del: integrated -- https://master.php.net/note/delete/78641/integrated Del: useless -- https://master.php.net/note/delete/78641/useless Del: bad code -- https://master.php.net/note/delete/78641/bad+code Del: spam -- https://master.php.net/note/delete/78641/spam Del: non-english -- https://master.php.net/note/delete/78641/non-english Del: in docs -- https://master.php.net/note/delete/78641/in+docs Del: other reasons-- https://master.php.net/note/delete/78641 Reject -- https://master.php.net/note/reject/78641 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#131588) next »