Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-06-10 06:36:22

streetdaddy
New Member
From: Adelaide, Australia
Registered: 2004-06-01
Posts: 8

Dynamic thumbnail from external image

Don’t get excited just yet! I want to make my first plugin but thought I’d see if someone else had already thought of it AND coded it ;)

Basically I want to display dynamically updated thumbnails of weather images such as:

This Synoptic chart

The parameters would be something like:

ImageUrl – location of image, must start with http://

PageUrl – location of page the image is on (for credit or linking to full size)

FullSizeWidth – width in pixels of full-size image (if 0, image size is calculated using aspect-ratio and FullSizeHeight)

FullSizeHeight – height in pixels of full-size image (if 0, image size is calculated using aspect-ratio and FullSizeWidth)

PurgeFullSizeImage – boolean to delete the original image after Full Size and Thumbnail images have been generated.

*** if FullSizeWidth and FullSizeHeight are both 0, original image is used for the Full Size Image and PurgeFullSizeImage is ignored

ThumbnailWidth – width in pixels of Thumbnail image (if 0, image size is calculated using aspect-ratio and ThumbnailWidth )

ThumbnailHeight – height in pixels of Thumbnail image (if 0, image size is calculated using aspect-ratio and ThumbnailHeight)

can’t think of anymore params right now….

Logic would be something like:

  • ImageUrl Exists?
  • If True
  • Image is JPG, GIF or PNG?
  • If True
  • Get Image and store using original filename
  • File already exists?
  • If True
  • Original File is older than New File?
  • If True
  • [Generate Thumbnail]
  • Output IMG tag linked to PageUrl
  • If False
  • Output IMG tag linked to PageUrl
  • If False
  • [Generate Thumbnail]
  • Output IMG tag linked to PageUrl

Well that makes about as much sense as a Doctor’s handwriting…

That’s a simple psuedo of what I have in mind. Basically I’d only want a thumbnail generated if the current thumbnail is outdated by the new image.

Feedback is appreciated and hopefully I’ll start coding it in the next week or so, provided someone else hasn’t already coded something that will do the above….

Cheers!

p.s. Something I’ve just thought of… Is the LZW patent up yet? Does GD2+ resize GIF’s? If not then I guess this’ll be a JPG, PNG only thing… :( bummer

Last edited by streetdaddy (2004-06-10 06:44:30)

Offline

#2 2004-06-10 11:44:31

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: Dynamic thumbnail from external image

You could always test for ImageMagick on the system and use that to do the resize, and use GD2 as a fallback.

Offline

#3 2004-06-10 13:38:05

marco
Member
From: Montreal
Registered: 2004-02-24
Posts: 62

Re: Dynamic thumbnail from external image

> streetdaddy wrote:

p.s. Something I’ve just thought of… Is the LZW patent up yet? Does GD2+ resize GIF’s? If not then I guess this’ll be a JPG, PNG only thing… :( bummer

I already expired in several countries, last coutry will be on July 1st – Canada, I believe…

Offline

#4 2004-08-03 15:03:04

shriek
New Member
Registered: 2004-02-24
Posts: 5

Re: Dynamic thumbnail from external image

well, just wanted to now the status of this plugin…

Offline

#5 2004-08-03 15:03:51

shriek
New Member
Registered: 2004-02-24
Posts: 5

Re: Dynamic thumbnail from external image

by the way, here’s something you might want to look at (maybe you already did):

http://www.evolt.org/article/PHP_frontend_to_ImageMagick/17/55650/

Offline

#6 2004-09-07 06:30:01

streetdaddy
New Member
From: Adelaide, Australia
Registered: 2004-06-01
Posts: 8

Re: Dynamic thumbnail from external image

sorry it took a while to reply shriek… not finding much time to play around with my personal site, to much damn work :(

I was considering adding ImageMagick support but I think I’ll just leave it as GD only and anyone else is welcome to extend the plugin functionality. I’ll post the plugin in the next few days…

Offline

#7 2004-12-07 15:07:24

shooka
New Member
From: Bristol, UK
Registered: 2004-12-07
Posts: 4
Website

Re: Dynamic thumbnail from external image

alright streetdaddy, did you end up posting this plugin?? i’m really interested in this one.

cheers lovely.

Offline

Board footer

Powered by FluxBB