IMG tag

Xavier

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,542
I've begged Deebs and we now have a working IMG tag in the imaging forum (i.e. here) - which means images can be posted in threads without attaching them.

Rather than just spooging an entire image in your posts, please use thumbnails wherever possible to preview the shots, as I've amended in the 2 posts here:

https://forums.freddyshouse.com//showthread.php?p=13457#post13457

It's not that we aren't all dying to see your holiday shots, more than anything else just tres annoying to have the page position jumping all over the shop as 10 posts containing 2Mb+ photos gradually load!
 

Ch3tan

I aer teh win!!
Joined
Dec 22, 2003
Messages
27,305
Hmm, you have to upload a thumbnail as well or the forums create one automatically?
 

Xavier

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,542
Ch3tan said:
Hmm, you have to upload a thumbnail as well or the forums create one automatically?
No, I just photoshopped those quickly.

We could I'm sure put together a copy of the imagegoo plugin to make thumbnails, but right now the manual alternative seems preferrable to downloading up to 20mb per page of full screen 4mp+ shots :)


There are a bunch of freeware utils out on the world wide wibble which will quickly make thumbnails on-demand too, if you have a google.

Xav
 

Tom

FH is my second home
Joined
Dec 22, 2003
Messages
15,991
It really isnt hard to reduce an image to 800x600 or so, people are just lazy.
 

Xavier

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,542
Not really, I think some people just like showing what the camera does at full res - resizing loses a lot of detail after all.

I'd prefer thumbnails linking to a full size shot rather than just 800x600 versions, quicker overall load times for pages and then a proper version of the photo, if i want to view it.
 

Sar

Resident Freddy
Joined
Dec 22, 2003
Messages
2,140
Set up an action in PShop to do it for you people - it can resize, sharpen and save the file for you in one fell swoop.

Or better still, use a droplet.
 

Xavier

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,542
*makes a sign for Sar's photoshop corner*

c'mon fella, you've got to write a step-by-step guide for everyone now ;)

Xav
 

Jonty

Fledgling Freddie
Joined
Dec 22, 2003
Messages
1,411
Hi guys

Just to say Paint Shop Pro 8 also has a macro facility for automating repetitive tasks :) You could also write a little PHP/ASP script which resizes images on the fly.

Kind Regards
 

dysfunction

I am a FH squatter
FH Subscriber
Joined
Dec 22, 2003
Messages
8,902
Jonty said:
Hi guys

Just to say Paint Shop Pro 8 also has a macro facility for automating repetitive tasks :) You could also write a little PHP/ASP script which resizes images on the fly.

Kind Regards

I have no idea what a PHP/ASP is let alone script it....
 

Sar

Resident Freddy
Joined
Dec 22, 2003
Messages
2,140
I shall knock up a guide to Photoshop actions (and anything else anyone needs help on) on Saturday, when I have a few hours to myself - this week's been a bit busy, what with exams et al.
 

Wazzerphuk

FH is my second home
Joined
Dec 22, 2003
Messages
12,054
I've got a suggestion: Post a sticky thread, with posting guidlines, with code so that people can post a small thumbnail that links to full image, or an 800*600 or whatever that links to it: so it's still fairly large for those interested to have a decent look, and anyone really interested will clickthru.

As long as people adhere, it is fine: this way you can also moderate the image size better, and anyone that doesn't will no doubt be pointed in the right direction. ;)
 

Jonty

Fledgling Freddie
Joined
Dec 22, 2003
Messages
1,411
Hi guys

Below is a very quick image resize script I have written in PHP. To utilise it, just open Notepad (or equivalent), paste the code below, save as a .php file, and upload to your webspace.


Code:
<?php
header("Content-type: image/jpeg");

$Location = $_GET["location"];
$Width = $_GET["width"];

if (!$Location) { exit(); }
if (!$Width) { $Width = 160; }

$Source = imagecreatefromjpeg($Location);
$Ratio = imagesy($Source)/imagesx($Source);

$Thumbnail = imagecreate($Width, $Width*$Ratio);
imagecopyresampled ($Thumbnail, $Source, 0, 0, 0, 0, $Width, $Width*$Ratio, imagesx($Source), imagesy($Source));

imagejpeg($Thumbnail);
imagedestroy($Thumbnail);
imagedestroy($Source);
?>
Use

To utilise the script, just link to the uploaded file and append the address with the '?location=' and the location of the image file you want to resize. You can also add an optional parameter which specifies the width of the thumbnail image (by default this is 160px). This is done by adding '&width=' and the number of pixels you want to the end of the address.

Examples

So, for example, if the PHP file is called 'resize.php' and is located at http://www.mydomain.com/ the file's address will be:


http://www.mydomain.com/resize.php
If you have an image in the same directory called 'sample.jpg', the address of the thumbnail will be:


http://www.mydomain.com/resize.php?location=sample.jpg
You can also resize off-site images, so say you have an image at http://www.myimagehost.com/sample.jpg, the thumbnail address will be:


http://www.mydomain.com/resize.php?location=http://www.myimagehost.com/sample.jpg
Finally say we want our original sample image to be 400px wide, not 160px as is default, the thumbnail address will be:


http://www.mydomain.com/resize.php?location=sample.jpg&width=400
Implementation

To add a thumbnail in the forums, use the following code:


As you can see, we're simply pointing the image source to our .php file, and linking that image to our original.

In X/HTML, we would simply point to our .php file in the image 'src' attribute.


<img alt="My Thumbnail" src="http://www.mydomain.com/resize.php?location=sample.jpg" />
Limitations

At present, there are some limitations with the script.

  1. Firstly, to keep the code clean, only .jpg files can be used as the image source (this is easy enough to change, however).
  2. Secondly, is an error occurs you won't receive a message, just a broken image on your page (again, this is easily remedied, but would require more code).
  3. Thirdly, the thumbnails produced will contribute to your site's bandwidth usage (the quality of the thumbnail can be altered, though, at present it's at its default compression level).
  4. Fourthly, the script requires a host server which supports PHP and the GD image library.
That's probably all as clear as mud, so if you have any questions, just shout.

Kind Regards

Jonty

P.S. I don't expect to use this script, but it's there if you need it :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom