Hey there,

sorry if this is a newbie question but I have been struggling for about two days now and its just been a one step forward two steps back situation!

What I am trying to do is allow admin users to upload pictures for properties up to a property rentals site (I know how to do this) then add the link to mySQL as part of the info that goes in the mySQL properties table (I can do this too).

Then what I want to do is use the info from the database to generate an img src link that I can use whereever (I can do this bit) BUT I want to use PHP to dynamically resize the image the link refers to depening on whether I am using it as a thumbnail or a full size image etc by mayber calling a 'thumbresize' function or something. I know you can resize with GD but you seem to have to save the file somewhere and I was hoping not to have to do that.

I may be barking up the wrong tree here but I just thought that rather than clutter up my folders (and more importantly the database) with three links for each image size it might be nice just to have one master image that PHP resizes according to where its shown.

To sum up I need some help writing the code that will take the result the mySQL image link (<img src=' " . $row['property_image_1'] . "' />) and make it the size needed for the page that is calling for that data.

Hope that make sense. Thanks geniuses, I am really struggling!

    Thats brilliant, thanks!

    BUT I don't think its going to work for me as the reason I need to do this is so that the property sales team (no techie skills) can just upload images from their digital cameras and the site does the rest. Yeah I know this tutorial would allow that but I could easily end up with customer search results (where there will be 5 or so properties a page) that are a 10mb download!

    What I need is for the image to actually be resized (resampled) before being sent from the server.

    The other thing that is doing my head in is how to put my string in quotes. The code I am using is below. Obviously its wrong but I just can't seem to get my head around the rules for getting it right (this includes the function from the 'Knox' tutorial):

    <?php
    <img src="..'.$row['property_image_1'].'" imageResize($originalimage[0],

    $originalimage[1], 150); ?>>

    Thanks for your help so far.

      I'm pretty sure the only way to resize/resample an image is by using Imagemagick or GD. I'm not 100% sure how to do this however...You may have to google for a solution.

        Have you solved this problem yet?

        You can resize an image very easy and display the result as a verable without having to save the result. This is using GD. I dont have the commands/functions right now, but i have work on my home pc which uses this method.

          Write a Reply...