Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-06-08 02:40:19

greenrift
Archived Plugin Author
Registered: 2004-03-08
Posts: 186
Website

mdp_Automatic Thumbnail's

I’ve finished a TXP Hack to automatically create thumbnail

Last edited by greenrift (2004-06-08 02:48:20)

Offline

#2 2004-06-08 06:07:48

elmar
Member
From: Southern Germany
Registered: 2004-03-22
Posts: 24
Website

Re: mdp_Automatic Thumbnail's

Very nice. This works great for me and is just what I was looking for. Thanks!

One tiny little bug, when I replace the image, it remakes the thumbnail with the wrong size. That is, when I use the “Image” panel in txp, and click on “replace this image”, the resulting thumbnail is bigger than the original. Solution is of course simply to delete the image and reload, but I thought I would let you know.

One suggestion: I use square thumbnails even with normal pictures (solves that vertical horizontal problem) and a lot of other people do too. PhotoStack can handle square thumbnails, it has a height and width property. Do you think you could add that in an upcoming version?

Thanks again for a great hack.

Offline

#3 2004-06-08 16:24:10

greenrift
Archived Plugin Author
Registered: 2004-03-08
Posts: 186
Website

Re: mdp_Automatic Thumbnail's

> elmar wrote:

> One tiny little bug, when I replace the image, it remakes the thumbnail with the wrong size. That is, when I use the “Image” panel in txp, and click on “replace this image”, the resulting thumbnail is bigger than the original. Solution is of course simply to delete the image and reload, but I thought I would let you know.

I can’t reproduce this error, replacing images is working fine for both my textdrive account and my local TXP install. It shouldn’t be doing this, my only suggestion would be to refresh the page a few times to make sure everything did go through right. I think I have an idea as to what the problem is, tell me the dimensions of the two images (the original and the one you want to replace it with) so I can be certain its what I’m thinking.

> One suggestion: I use square thumbnails even with normal pictures (solves that vertical horizontal problem) and a lot of other people do too. PhotoStack can handle square thumbnails, it has a height and width property. Do you think you could add that in an upcoming version?

Yah, I can add the ability to define a height as well when making the thumbnail. I’ll include it when I figure out your bug fix.

Offline

#4 2004-06-08 17:25:48

elmar
Member
From: Southern Germany
Registered: 2004-03-22
Posts: 24
Website

Re: mdp_Automatic Thumbnail's

The fullsize image is 400px wide, I replaced it with a smaller one (250px) and also with the same image. The thumbnails are 50px wide. I will fiddle around and see if it doesn’t do it with other sizes.

When i upload an image, it makes the thumbnail the size I want (50px). Then when I replace the image, it makes a 200px image. Hope this helps.

Offline

#5 2004-06-08 18:46:52

nimnix
Archived Plugin Author
Registered: 2004-05-26
Posts: 63
Website

Re: mdp_Automatic Thumbnail's

I’m having script errors when I try to use this:
According to my webhost, GD 2.0.15 is installed

*****
Warning: imagecreatetruecolor(): requires GD 2.0 or later in …/txp_image.php on line 420

Warning: imagecopyresampled(): requires GD 2.0 or later in …/txp_image.php on line 426

Warning: imagejpeg(): supplied argument is not a valid Image resource in …/txp_image.php on line 428

Warning: imagedestroy(): supplied argument is not a valid Image resource in …/txp_image.php on line 430

Warning: imagecreatetruecolor(): requires GD 2.0 or later in …/txp_image.php on line 392

Warning: imagecopyresampled(): requires GD 2.0 or later in …/txp_image.php on line 398

Warning: imagejpeg(): supplied argument is not a valid Image resource in …/txp_image.php on line 402

Warning: chmod failed: No such file or directory in …/txp_image.php on line 403

Warning: imagedestroy(): supplied argument is not a valid Image resource in …/txp_image.php on line 404

*****

Last edited by nimnix (2004-06-09 18:32:28)


textpattern.org :: find and share Textpattern resources
textpattern.net :: TextBook – Textpattern wiki

Offline

#6 2004-06-08 19:34:13

jeffkono
New Member
Registered: 2004-05-26
Posts: 7

Re: mdp_Automatic Thumbnail's

Great hack! It would be nice if the next version of TXP included this by default, together with some interface to change its settings.

Better yet, TXP could have a more flexible admin interface, modifiable by plugins. (this was suggested before in another thread).

Offline

#7 2004-06-09 01:15:42

greenrift
Archived Plugin Author
Registered: 2004-03-08
Posts: 186
Website

Re: mdp_Automatic Thumbnail's

> nimnix wrote:

> I’m having script errors when I try to use this:
According to my webhost, GD 2.0.15 is installed

Create a text file, place this code in it:

<?php echo "<pre>"; var_dump(gd_info()); echo "</pre>"; ?>

Upload it and make its extension “.php”. Then make sure you run the page and tell me what it says. Because PHP shouldn’t give warnings on that stuff if GD 2.0 or higher is installed and PHP is greater than 4.0.6.

Last edited by greenrift (2004-06-09 01:22:23)

Offline

#8 2004-06-09 04:45:28

nimnix
Archived Plugin Author
Registered: 2004-05-26
Posts: 63
Website

Re: mdp_Automatic Thumbnail's

Fatal error: Call to undefined function: gd_info() in /mydirectory/phpinfo.php on line 26

It seems I may have to work with my host on this more


textpattern.org :: find and share Textpattern resources
textpattern.net :: TextBook – Textpattern wiki

Offline

#9 2004-06-09 04:53:19

Caged
Archived Plugin Author
From: Memphis, TN
Registered: 2004-06-07
Posts: 27
Website

Re: mdp_Automatic Thumbnail's

Try putting this in a file (.php extension) and see if you find gd listed on the page, I’m almost certain gd isn’t installed for you.

<?php phpinfo(); ?>


Isolated-Designs http://www.isolated-designs.net/core

Offline

#10 2004-06-09 04:54:51

Daragh
Member
From: Toronto Canada
Registered: 2004-05-26
Posts: 60
Website

Re: mdp_Automatic Thumbnail's

Where should I be seeing the option to create the thumbnail? I guess I’m confused on how to use this thing, but then I’m extremely new to txp, so…

Offline

#11 2004-06-09 05:20:57

Caged
Archived Plugin Author
From: Memphis, TN
Registered: 2004-06-07
Posts: 27
Website

Re: mdp_Automatic Thumbnail's

Works great greenrift, thanks for sharing.

Edit: Small Bug, in the image_delete() function you’ve missed a ‘g’ that was causing the script not to be able to delete an image.

line 340 needs to be

$id = gps('id');

instead of
$id = ps('id');

Cheers

Last edited by Caged (2004-06-09 05:31:50)


Isolated-Designs http://www.isolated-designs.net/core

Offline

#12 2004-06-09 05:30:00

nimnix
Archived Plugin Author
Registered: 2004-05-26
Posts: 63
Website

Re: mdp_Automatic Thumbnail's

GD is installed, and when I use older functions, like imagecopyresized, they work. It’s the functions that came in version 2 that don’t work.


textpattern.org :: find and share Textpattern resources
textpattern.net :: TextBook – Textpattern wiki

Offline

Board footer

Powered by FluxBB