close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Image Resizer in an href

Thread began 11/13/2011 3:19 pm by Brainthief | Last modified 12/06/2011 10:41 am by Jason Byrnes | 1241 views | 8 replies |

Brainthief

Image Resizer in an href

I am trying to use image resize with another script. The script reveals a larger image inside of a div using an href...
Does anyone know... what is the best way to insert a dynamic cached image in an href like below?
Thanks!

<?php
if(TRUE){ // Begin Cached Resized Image: ImageCacheInstance_1321208809944
ob_start();
?>
<a href="PATH TO LARGE CACHED IMAGE HERE" rel="enlargeimage" rev="targetdiv:loadarea,link:http://somewhere.com"><img src="images/<?php echo $row_rsImages['filename']; ?>" alt="" name="" width="32" height="32" /></a>
<?php
echo(getCachedResizedImageHTML(ob_get_clean(), "image_cache", "crop", "", false));
} // End Cached Resized Image: ImageCacheInstance_1321208809944
?>

Sign in to reply to this post

Dani Chankhour

What you will need to do is find the location of where the image is being stored by image resizer. Then you will need to use that url in the href="" and switch the image file name to by dynamic (pull it from the record set).

Sign in to reply to this post

Brainthief

Thanks for the reply...
I have used the path to the full size image but that is not what I want...
<a href="gallery_images/<?php echo $row_rsImages['filename']; ?>" rel="enlargeimage" rev="targetdiv:loadarea,link:http://somewhere.com">

I want a thumbnail image...
How do I specify a path to generate a new dynamic image?

Sign in to reply to this post

Brainthief

Can you show me an example?

Sign in to reply to this post

Dani Chankhour

You need to use the path that is generated by image resizer.

Can you please send me a url of where i can see an image resized by image resizer and i can explain how to modify the href.

Sign in to reply to this post

Brainthief

Please give me an example of a path that is generated by image resizer?
The large image is not created. there is not a path to it. I need to create it from the thumbnail code below.

This is how I'm creating the thumbnail;

<?php
if(TRUE){ // Begin Cached Resized Image: ImageCacheInstance_1321208809944
ob_start();
?>
<a href="PATH TO LARGE CACHED IMAGE HERE" rel="enlargeimage" rev="targetdiv:loadarea,link:http://somewhere.com"><img src="images/<?php echo $row_rsImages['filename']; ?>" alt="" name="" width="32" height="32" /></a>
<?php
echo(getCachedResizedImageHTML(ob_get_clean(), "image_cache", "crop", "", false));
} // End Cached Resized Image: ImageCacheInstance_1321208809944
?>

Sign in to reply to this post

Jason ByrnesWebAssist

basically, you need to create a page that will use image resizer to create the large images. Open that page in a browser and view the source code.


the source code will show you the path to use to access them in the anchor tag.

Sign in to reply to this post

Brainthief

I still have not got this to work.
Thanks for your help.

I created a page and this is the code used from image resizer;
<?php
if(TRUE){ // Begin Cached Resized Image: ImageCacheInstance_1323139609713
ob_start();
?>
<img src="images/<?php echo $row_rsImages['filename']; ?>" width="300" alt="test" />
<?php
echo(getCachedResizedImageHTML(ob_get_clean(), "image_cache", "proportion", "", true));
} // End Cached Resized Image: ImageCacheInstance_1323139609713
?>

And this is the generated path;
<img src="image_cache/images/proportion/adr20_w300_h482/adr20_11290527.jpg" width="300" alt="test" />

I need for the image to be dynamic.
I can't hard code to the larger image...
The original image name in the database is adr20.jpg and the original size is 600px wide.
There could be 1,000 images at any time, the width should be resized to 300px wide, the height will be determined by the original uploaded image, old images get deleted and new ones get created often.
When the user hovers over the small image it should reveal the larger, 300px wide, image in the div "loadarea"...
How do I make "image_cache/gallery_images/proportion/adr20_w300_h482/adr20_11290527.jpg" dynamic?

The small image works just like I want it...
Here is the small image and the link;
<?php
if(TRUE){ // Begin Cached Resized Image: ImageCacheInstance_1321208809944
ob_start();
?>
<a href="PATH TO LARGE 300PX WIDE CACHED IMAGE HERE" rel="enlargeimage" rev="targetdiv:loadarea,link:http://somewhere.com"><img src="images/<?php echo $row_rsImages['filename']; ?>" alt="" name="" width="32" height="32" /></a>
<?php
echo(getCachedResizedImageHTML(ob_get_clean(), "image_cache", "crop", "", false));
} // End Cached Resized Image: ImageCacheInstance_1321208809944
?>

How do I get the below into the href?
<?php
if(TRUE){ // Begin Cached Resized Image: ImageCacheInstance_1323139609713
ob_start();
?>
<img src="images/<?php echo $row_rsImages['filename']; ?>" width="300" alt="test" />
<?php
echo(getCachedResizedImageHTML(ob_get_clean(), "image_cache", "proportion", "", true));
} // End Cached Resized Image: ImageCacheInstance_1323139609713
?>

Sign in to reply to this post

Jason ByrnesWebAssist

Image resizer cannot dynamically generate the path used in the href tag. This is a limitation of image resizer.

it can only resize the images, it cannot dynamically generate the path used by the href tag.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...