Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Thumbnails with links

Quote Reply
Thumbnails with links
I would like to be able to have an owner upload an image as part of adding a link, and display that image on a static detailed page. No sweat, I've done that before... Smile

Now, I would also like to put a thumbnail of that image next to that entry's listing on the category page... Now I'm sweating. I think I can figure out where to put the call, but I missed the basics... Pirate

Is there a way to tell Links to display the same image with one set of dimensions on the detailed page and a different (smaller) set of dimensions on the category page? Crazy

If not, how do I get to where I want to be?

Alan Frayer
Don't just read the news - make the news!
Your World News - http://yourworldnews.frayernet.com
Quote Reply
Re: [afrayer] Thumbnails with links In reply to
Hi,

Are you using Thumb_Images? If so, then it shouldn't be too hard to make it create 2 versions (i.e small and large). Then, just call it in pretty much the same way as you would normally, but using a slightly different tag (i.e URLToImageSmall and URLToImageMedium.

If you confirm you're using ThumbImages, I'll see what I can put together for you =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Thumbnails with links In reply to
In Reply To:
Hi,

Are you using Thumb_Images? If so, then it shouldn't be too hard to make it create 2 versions (i.e small and large). Then, just call it in pretty much the same way as you would normally, but using a slightly different tag (i.e URLToImageSmall and URLToImageMedium.

If you confirm you're using ThumbImages, I'll see what I can put together for you =)

Cheers
I'm not using ThumbImages, and I don't know anything about it. Unsure Andy, if this is one of your plugins, can you give me an idea of what it is, or a link to learn more? What I'd like to avoid is the need for the LinkOwner to upload two versions of the same file, and would also like to avoid having to manually create the thumbnail, as the database would be a bit too large for that to be practical.

Alan Frayer
Don't just read the news - make the news!
Your World News - http://yourworldnews.frayernet.com
Quote Reply
Re: [afrayer] Thumbnails with links In reply to
Hi,

No problem. Heres the detailed page for it: http://ultranerds.com/cgi-bin/details/21.html

I have a version that will create a small-xxx.gif, inter-xxx.gif and large-xxx.gif version (based on the original - full sized image).

An example would be;

small - 50x50 pixels
intermediate - 100x100 pixels
large - 200x200pixels
full - whatever dimension they uploaded

Hope that helps :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Thumbnails with links In reply to
That was helpful, Andy. You indicate the need for three additional modules that I presume are not included with a standard Links 3.x installation. These are 3rd party modules? If so, where would I find them?

Now, assuming I use your solution, the LinkOwner uploads his graphic and creates his own thumbnail? This is not a transparent process for the LinkOwner, then? And where would I find the thumbnail graphic (or any of them, for that matter), so I could reference them in the templates?

Alan Frayer
Don't just read the news - make the news!
Your World News - http://yourworldnews.frayernet.com
Quote Reply
Re: [afrayer] Thumbnails with links In reply to
Hi,

Yes, Image::Magick and Image::Size are required (most hosts have these installed, but if not.. then they should be able to set them up for you :)).

A simple test script would be;

Code:
#!/usr/bin/perl

use CGI::Carp qw(fatalsToBrowser);
use Image::Size;
use Image::Magick;

print "Content-Type: text/html \n\n";
print "Looks ok :)";

Just upload it as test.cgi, CHMOD to 755, and try running it from SSH/a browser.

If you get an error message about "can't include...", then that means you need to get one (or possibly both) of those modules installed by your host.

Quote:
Now, assuming I use your solution, the LinkOwner uploads his graphic and creates his own thumbnail? This is not a transparent process for the LinkOwner, then? And where would I find the thumbnail graphic (or any of them, for that matter), so I could reference them in the templates?

Yeah, basically.

The current version lets you use ANY table in LinksSQL/GLinks.

For example, you could add an image called "Screenshot" to the "Links" table (as a FILE, locally stored). Then, in the plugin settings.. you would just set the "Screenshot" field as the ImageField.

There is a "cleanup" function too, that will regenerate the smaller images (i.e if you change your desired dimensions, for example to something larger).

An example from one of my own sites;

Small Image:
<%if Image%><img src="<%Plugins::Thumb_Images::ThumbURL($ID,'Image','Category')%>" border="0" /><%endif%>

Full Image:
<%if Image%><img src="<%Plugins::Thumb_Images::ThumbFullURL($ID,'Image','Category')%>" border="0" /><%endif%> &nbsp;

Its as simple as that :) (the URL is automatically generated for you, via the above tags).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Thumbnails with links In reply to
In Reply To:

Quote:
Now, assuming I use your solution, the LinkOwner uploads his graphic and creates his own thumbnail? This is not a transparent process for the LinkOwner, then?

Yeah, basically.
I liked everything except this point... what's to stop the LinkOwner from creating oversized graphics that screw-up the layout of a detailed page or category page?

I suppose it's actually more logical than I'm imagining, but I can't get over the thought that the LinkOwner shouldn't be the one deciding how big the pictures should be.

Alan Frayer
Don't just read the news - make the news!
Your World News - http://yourworldnews.frayernet.com
Quote Reply
Re: [afrayer] Thumbnails with links In reply to
Hi,

The linkowner doesn't decide the size of the image =)

You can set a maximum file size (for example 25000 bytes).

Another option, is to let them upload whatever size they want, and then ONLY ever show the processed images. For example;

  • Example of SMALL image: (i.e 100x100) - <%Plugins::Thumb_Images::ThumbSmallURL(OPTIONS)%>
  • Example of INTERMEDIATE image: (i.e 250x250) - <%Plugins::Thumb_Images::ThumbInterURL(OPTIONS)%>
  • Example of FULL image: (i.e the original size) - <%Plugins::Thumb_Images::ThumbFullURL(OPTIONS)%> You don't even need to use this, if you're worried about people "exceeding" the desired size)

I've been using it on my site for a long time (one example, is cool-clipart.com - which relies fully on the thumbnailed images, to stop the left sidebar from expanding too far [i.e with large images]).

Hope that clears things up :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [afrayer] Thumbnails with links In reply to
FWIW: I couldn't get Image::Magick to work on several of my servers over the years, and I have a Unix solution for thumbnailing using the netpbm utility package. It's a series of filters that can be installed in a protected directory, they don't have to be installed into perl or the system itself, as long as they can be called from inside the script.

Image::Magick is now standard on many hosting platforms, and with some Linux flavors now.

It's not as hard as it used to be to get image processing done.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [Andy] Thumbnails with links In reply to
Hi Andy,

I submitted a ticket at ultranerds 3 days ago regarding your thumbnail plugin, and I was wondering when you guys check your ticket system?

Also, my host provider has informed me that they installed Image::Magick for me, but when running the test, it gives me internal server error.

Here's my test:
Code:
#!/usr/bin/perl
#!/usr/local/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use Image::Size;
use Image::Magick;
print "Content-Type: text/html \n\n";
print "Looks ok :)";


Only if I delete both Image:: lines do I get the ok message.
This is why I am looking for a demo or something to make sure I can get your plugin
working on my server before forking over the $50, and I am not getting a reply via your site.

Thanks for any assistance.
Chris
RGB World, Inc. - Software &amp; Web Development.
rgbworld.com

Last edited by:

rgbworld: Mar 31, 2006, 11:44 AM
Quote Reply
Re: [rgbworld] Thumbnails with links In reply to
Well, I got the errors taken care of with the test script posted in previous post,
and I have purchased the plugin, but Ultranerds seems to be MIA at both your site and here.

Can I please somehow get the plugin I purchased?
RGB World, Inc. - Software &amp; Web Development.
rgbworld.com
Quote Reply
Re: [rgbworld] Thumbnails with links In reply to
Hi,

Should be sorted now. Sorry for the delay, I've been bogged down with my daytime job :(

The ticket system is pretty new too - and I'm still getting used to it :P (I've turned on email notifications now =)).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!