We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

plugin: Image Sizer

Development and Programming

Dane Thomas's avatar
Dane Thomas
139 posts
17 years ago
Dane Thomas's avatar Dane Thomas

Ah thats great lumis - works a treat.

phpThumb officially dropped.

       
lumis's avatar
lumis
119 posts
17 years ago
lumis's avatar lumis

about the URL’s with IP’s i tried it on a server running php4 and php5 and it worked on both. i would recommend not using a url and just use a absolute path /images/uploads/filename.jpg

{exp:imgsizer:size src="/images/uploads/filename.jpg" width="100"}

also you could turn on debug and see where the error occurred

{exp:imgsizer:size src="/images/uploads/filename.jpg" width="100" debug="1"}
       
Dane Thomas's avatar
Dane Thomas
139 posts
17 years ago
Dane Thomas's avatar Dane Thomas

I’ve been using this plugin on a site i’m developing successfully for some time although tonight all the images stopped working.

I’ve added the debug=”1” code to the previously working tags and the output is /noodleboxes.jpg could not be found

If i just put the custom field in it displays the full image path which words fine. Any ideas?

The images are on the server and the cache dirs are there.

EDIT: ah nevermind. HTTP had crashed on the server earlier today and had ‘automagically’ restarted but it seemed maybe GD2 or some other module hadn’t reloaded. A restarted of Apache fixed the issue.

       
sambo's avatar
sambo
80 posts
17 years ago
sambo's avatar sambo

Love this plugin. THX!

Having one problem that I am not even sure that relates to the plugin at all.

Do you know why this gives me an error?

{exp:strip_p}{images_for_header_big_file}{/exp:strip_p}
{exp:imgsizer:size src="{exp:strip_p}{images_for_header_big_file}{/exp:strip_p}" width="70" height="70" alt="{title}" parse="inward" debug="1"}

While this doesn’t:

{exp:imgsizer:size src="{exp:strip_p}{images_for_header_big_file}{/exp:strip_p}" width="70" height="70" alt="{title}" parse="inward" debug="1"}

The code is exactly the same but the top one has an extra line that should not have any affect on what imgsizer is doing?????

The error is [path to file]/M40o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr. could not be found

And by the way - the reason I am using strip_p is because I am using LG tinyMCE imagemanager field for the image and it adds a P tag around the contents.

Best, Sammi

       
Dane Thomas's avatar
Dane Thomas
139 posts
17 years ago
Dane Thomas's avatar Dane Thomas

To uncomplicated things i’d add a custom field for the image )either as a text field) or better still using Marks File extension which works perfectly with this plugin.

At least then you don’t have to worry about stripping anything and then you also have the flexibility of displaying more than one resized image.

I think using TinyMCE for an image field is going to cause more issues than it’s worth.

       
sambo's avatar
sambo
80 posts
17 years ago
sambo's avatar sambo

Yes. you are right. It would make sense to use Mark’s great plugin for this. BUT when you have already convinced your client to purchase the Imagemanager & Filemanager from TinyMCE - and trained him to use them- it doesn’t sound to good to confuse him with another method of uploading/managing files.

I think I might however end up doing so 😉

Best, Sammi

       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.

Ran into a potentially major problem with this plugin on a recent build. It seems when the PHP memory limit is exhausted while this is trying to work on an image, that any page the plugin is on where it is calling an image will return entirely blank.

Our situation: We allow users to registeron the site and then they can upload a picture of their pet. Ideally we’d like to have everyone upload a reasonably sized image, but as we all know, resolution and filesize are like Greek to most people (is it un-PC to pick on that language these days? Anyway…) After you’ve uploaded a picture of your pet, it can appear in many places and in a few different sizes which we’re controlling on the template with Image Sizer.

Our Problem: The problem (or insofar as we were able to narrow the problem down) comes when an image is basically bigger than 800x600 (note that on the file upload preference we don’t have ANY restriction in place right now, so we’re able to upload 1-2MB files for testing). It seems that if, at any point Image Sizer tries to resize an image that would break the PHP memory requirement, the whole page renders blank. We tested many many different size images, and when we got an image that was just over the threshold, we were able to see an error on the page:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 
1200 bytes) in /var/www/html/system/core/core.image_lib.php on line 495

To help determine if this was limited to Image Sizer, I uploaded phpThumb and took a 2.3MB image and did all sorts of fun things with it without a problem.

I’m wondering if this has something to do with the fact that Image Sizer is relying on an EE core file and there is some sort of limitation there that I’m not aware of (which may explain why the whole page blanks out) - while phpThumb is its own script and performs its operations independently of EE. Has anyone else encountered blank pages when using Image Sizer?

       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.

To elaborate a little with examples, we have a 2.2MB image, with dimensions of 1232 x 1840 in size, uploaded to a field called pet_picture.

Calling that particular uploaded image, the imgsizer line returns a totally blank page, with no error generated or anything:

{exp:imgsizer:size src="/images/uploads/pets/{pet_picture}" width="200" alt="{title}"}

So I comment out that line and try the phpThumb method. This returns the picture, sized 200 pixels wide, as we’d expect.

/phpThumb/phpThumb.php?src=/images/uploads/pets/{pet_picture}&w=200

Same page, same picture, two methods of resizing on the fly. I’ll have to use phpThumb in this case because we can’t rely on every regular user knowing to size things down appropriately before uploading - but it would be nice to understand why Image Sizer isn’t working as I’d expect here…because it’s so cool, it’s a shame not to be able to use it!

       
lumis's avatar
lumis
119 posts
17 years ago
lumis's avatar lumis

This error is coming from the core EE image lib… if you want to e-mail me the image you are testing with i will try and track down the problem. it may be we would have to hand this over to EE support but i can look into it..

       
Ryan M.'s avatar
Ryan M.
1,511 posts
17 years ago
Ryan M.'s avatar Ryan M.

I’m not sure you need the exact image (if you do, I can send it along) - but it’s a 2.3MB (sorry, previous post was incorrect on size) JPG, with 1232 x 1840 dimensions. We are assuming that some users of this site will be taking their images directly off of their digital cameras with little or no editing or cropping (imagine your aunt who has 50 cats trying to use Photoshop Elements or whatever comes on a cheap PC from a box store to “Save for web”…probably not going to happen) so we just want to make sure we could handle the larger images.

I tried using a flash upload solution to read the size of the image before the user even uploads it, but the server we’re working on didn’t seem to like that at all, so I’m just sticking with a standard HTML file upload field in this case.

UPDATE: Attached is a Finder look at the image - nothing unusual about it - the resizing works fine with phpThumb.

       
lumis's avatar
lumis
119 posts
17 years ago
lumis's avatar lumis

yeah i am doing the same thing here http://wkrg.com/weather_gallery/submit/ where it could possibly come from any kind of quality digital camera. my example is Gallery Extended as a upload form and then i use the Gallery Medium size as the resizing image. just to help with processor performance.

the error is coming from the resize function in the EE core lib but im not sure why it would be restricting the size limits.

when i get a chance today i will do some test with some full size images shot with my Canon 5D

       
Jolantis's avatar
Jolantis
4 posts
17 years ago
Jolantis's avatar Jolantis

First I have to say that this is a great plugin!

But I have two questions implementing it:

1. Is it possible to change the ‘cache’ directory location? And how? Why? When you go to publish or edit a entry and click the ‘upload file’ link and then the ‘view’ button to select an (already uploaded) file, you’ll also see all the files in the cache directory, because it’s a subdirectory of the ‘/images/upload/’ directory. And I would like to not see the cached images, only the original images.

2. Is it possible to not create an ‘resized’ image, if the original image is smaller than the defined width and height? So when I define the the width and height in the single image sizer tag (f.i. {exp:imgsizer:size src="{painting}” alt=”{title}” width=”971” height=”801” id=”picture”}) and the original uploaded image is smaller than 971px x 801px, can the link to the image (src=”…”) be the link to the original image instead of the (though not really resized) version in the cache directory, but with the correct/real width and height attributes added to the <img > tag?

Thanks a lot.

       
pmatos's avatar
pmatos
11 posts
17 years ago
pmatos's avatar pmatos

Sorry for double posting, I found this thread after I already asked the question on a new thread :(

When I try to reduce png images with Image Sizer and GD2, the resized pictures come up with a black background, and aren’t longer transparent. How can this be fixed so the resized pictures are transparent as well?

Thanks a lot!

       
j25's avatar
j25
47 posts
17 years ago
j25's avatar j25

The Image Sizer plugin is only working when it wants to. For some reason, some jpeg images will just not work. They are sized the same as the others, named correctly (I have even changed the names).

The files are uploading correctly and the large image is viewable, but the Image Resizer is just not creating a thumbnail image. This is happening to about every third or fourth image I upload. No rhyme or reason.

Any thoughts?

Thank you in advance.

       
noregt's avatar
noregt
360 posts
17 years ago
noregt's avatar noregt

Hi,

I noticed that the script is vulnerable for corrupt jpegs. I had a jpeg that did not upload properly, with the consequence that my whole site gave a PHP error.

Parse error: syntax error, unexpected ‘/’ in mysite/system/core/core.functions.php(635) : eval()’d code on line 47

Took me some time to discover that the image was the cause. I re uploaded the file and my site is back online. Anyway to prevent this from happening?

I wouldn’t want this to happen to my users!

       
First 6 7 8 9 10 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.