Jump to content

bonecone

New Members
  • Posts

    4
  • Joined

  • Last visited

bonecone's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Aaaah, gotcha. Okay thx. I'd already seen code like this before: header('Content-type: image/jpeg'); $image = new Imagick('test.jpg'); echo $image; But I just didn't know it could be placed inside an SRC attribute. I thought it could only be used in order to print something straight to the browser window, just like when you right-click an image and select View Image. Okay cool!
  2. This would work as an src attribute of an <img>? I was talking about the difference between showing the image within the src attribute of an img like so: http://i.imgur.com/DB7MmeW.png or going straight to the images own url like this: http://i.imgur.com/j4HL68G.png The only example I've ever seen of using PHP to directly print an image resource to the screen has been the second one, but I want to do the first. I don't understand how to so this without also making it directly accessible. ie: you can right-click on it and select "View Image" and go straight to its URL.
  3. What do you mean by "sending the data to the client"? I want to be able to display images on the webpage itself, not just open up a save-as dialog-box when the user clicks on a link, or print it straight to the page in the same sort of view as you get when you right-click a picture and select "View Image". What sort of context do you mean?
  4. I'm building an image board and I want to make sure there's no malicious php code inside of uploaded images before they get written to disc, and I want to use IMagick instead of GD because its writeImages method preserves gif animation. I've been testing my code on the example image on this page: (it's just php_info()) http://php.webtutor.pl/en/2011/05/13/php-code-injection-a-simple-virus-written-in-php-and-carried-in-a-jpeg-image/ I've been able to remove the php using GD: $im = imagecreatefromjpeg($_FILES['image_upload']['tmp_name'][index]); imagejpeg($im, $file_path); I just use call_user_func in order to adapt it to different image formats: call_user_func("imagecreatefrom" . $mime_type, $_FILES['image_upload']['tmp_name'][index]) call_user_func("image" . $mime_type, $im, $file_path); But like I said, animated gifs get turned into static gifs this way. So how do I do the same thing with IMagick?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.