Hi all,

I'm having some trouble with a resize script that I've found here: http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php

If I use the usage for resizing on the fly...(adapted slightly to $GET the url retrieved from the db)

<?php
   header('Content-Type: image/jpeg');
$url = $_GET['url'];
   include('SimpleImage.php');
   $image = new SimpleImage();
   $image->load($url);
   $image->resizeToWidth(150);
   $image->output();
?>

and call that 'resize.php', then I correctly get the 800px high image resized to 150px wide and displaying in the browser, the link

Problem is, when I try and call that image into a webpage in order to display it, nothing happens - no image is displayed, conversely I know I'm missing something obvious here, but I don't know what it is!

<img src="resize.php?url = <?php echo $jacket['resource_url'];?>" />
<!--displays nothing-->

<a href="resize.php?url = <?php echo $jacket['resource_url'];?>" />Click here</a>
<!--works perfectly-->

Can someone tell me what I'm missing please, I know it's going to be something really obvious!

Cheers!


    Gah.

    I don't believe it - I undid a change I thought I'd made which fixed it - all it was was a path problem in my <img> tag.

    Sincere apologies!

      Write a Reply...