Hey all…
Can Image Sizer save the created thumbs to Amazon S3?
I’m wanting to use Stephen Lewis’s Bucketlist add-on to upload images to Amazon S3, and Image Sizer to create thumbs on the fly. Buuuuuuut…. If I understand correctly, this setup would work ok, but the thumbs would still be on the local server instead of on the S3 cloud. And for scalability, I’d really like the original pics AND resized thumbs to be served from Amazon.
Hence the question… Can Image Sizer save the created thumbs to Amazon S3? And if not, does anyone know how tough it would be to make that happen?
Thanks
Hey all… Can Image Sizer save the created thumbs to Amazon S3? I’m wanting to use Stephen Lewis’s Bucketlist add-on to upload images to Amazon S3, and Image Sizer to create thumbs on the fly. Buuuuuuut…. If I understand correctly, this setup would work ok, but the thumbs would still be on the local server instead of on the S3 cloud. And for scalability, I’d really like the original pics AND resized thumbs to be served from Amazon. Hence the question… Can Image Sizer save the created thumbs to Amazon S3? And if not, does anyone know how tough it would be to make that happen? Thanks
You can use the remote=”on” parameter, but the issue I’m having with Amazon S3 + imgsizer, is that you can’t have any “folders” in your bucket path.
To fix my bucketlist issue of not being able to parse files with directories, while using the remote parameter, search for line 670
$save_name = $img['url_host_cache_dir'].$save_mask."-".$url_filename['basename'];
add this line right below (671)
$save_name = str_replace('/', '_', $save_name);
hello All, I’m receving a server error when running imgsizer to resize some photos.
There error I get is:
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 9000 bytes) in /home/ethesch4/public_html/mysite.com/panel/expressionengine/third_party/imgsizer/pi.imgsizer.php on line 555
The {articles-and-media-image-width} is pulled from a field the channel entry. Essentially, I want the photos on the individual article pages to have different sized photos but default to 250 pixels when no value is set. All the article pages are working fine, but the one that is left empty, which would assume the photo is 250 pixels using the conditional below generates the error from above.
Any ideas?
{if articles-and-media-image-width != ""}
{exp:imgsizer:size src="{articles-and-media-image}" width="{articles-and-media-image-width}"}
<span class="framedPic">
{sized}</span>
{/exp:imgsizer:size}
{if:else}
{exp:imgsizer:size src="{articles-and-media-image}" width="250"}
<span class="framedPic">
{sized}</span>
{/exp:imgsizer:size}
{/if}
Hi All,
Having an issue with this plugin when working it into the conditional below:
{exp:query sql="SELECT username, member_id, screen_name, bio, sig_img_filename, photo_filename FROM exp_members ORDER BY RAND() LIMIT 1"}
{exp:member:custom_profile_data member_id="{member_id}"}
{if photo_filename}
{exp:imgsizer:size image="/images/member_photos/{photo_filename}" width="196" height="160"}
{if:else}
{exp:imgsizer:size image="/images/member_photos/noprofileimage.png" width="196" height="160"}
{/if}
{/exp:member:custom_profile_data}
{/exp:query}
When the webpage returns the if:else the correct image loads and places fine but I also get an error in the header:
A PHP Error was encountered Severity: Notice Message: getimagesize() [function.getimagesize]: Read error! Filename: plugins/pi.imgsizer.php Line Number: 151
Has anyone had a similar issue or know what may be causing this?
Cheers Dave
I found I had a project that needed me to specify the maximum width and height to use without cropping, so that the image would resize proportionally to fit within the dimensions.
To do that, I hacked the plugin as follows:
I added the a “shrink” parameter at around line 373:
$shrink = ( ! $TMPL->fetch_param('shrink')) ? '' : $TMPL->fetch_param('shrink');
And I stuck new code for shrinking and the existing cropping code into an if statement that depended on the value of the new shrink parameter at around line 424:
// -------------------------------------
// shrink if we shouldn't crop.
// -------------------------------------
if ($shrink=="yes") {
//pick which ratio to use
$my_ratio = ($x_ratio < $y_ratio) ? $x_ratio : $y_ratio;
$img['out_width'] = ceil($my_ratio * $width);
$img['out_height'] = ceil($my_ratio * $height);
}
else
{
// -------------------------------------
// Do we want to Crop the image?
// -------------------------------------
if($max_height != '9000' && $max_width != '9000' && $max_width != $max_height)
{
$img['crop'] = "yes";
$img['proportional'] = false;
$img['out_width'] = $max_width;
$img['out_height'] = $max_height;
}
// -------------------------------------
// Do we Need to crop?
// -------------------------------------
if($max_width == $max_height && $auto == ""){
$img['crop'] = "yes";
$img['proportional'] = false;
$img['out_width'] = $max_width;
$img['out_height'] = $max_height;
}
}
I love this plugin, and have used it on every EE site I’ve done for years. Thanks for writing it!
Has anyone found a solution for the blank plug-in manager screen when installing most recent imgsizer?
Is there any way someone could post a link to v2.5.5? or whichever one makes it work?
Great plug-in btw! Thanks a million for it, my hero….
****EDIT****
problem solved: was running php4, who knew that media temple would run php4 by default…. anyways, works now!
I was also having problems with imageSizer 2.5.6 and the path settings when EE is installed in a sub-directory. This was the suggestion from my host with regards to the correct setting of $base_path by imageSizer:
$_SERVER[‘DOCUMENT_ROOT’] is probably not the proper way to go, because you aren’t always guaranteed to install it in the document root, as you have found. This is really no different than if the site was example.com/news/index.php with EE installed in a news directory. I would suggest submitting a bug report with the plugin author, and until a solution is found that does not require the $_SERVER[‘DOCUMENT_ROOT’] variable, consider: PATH_THEMES.’../images/’ or perhaps: PATH.’../images/’ if your system directory resides at the same level as the main ‘images’ folder.
Is this the right place for a feature request?
I was thinking it would be really handy if you could do something like this:
Currently if you specify both the width/height parameters like this:
if you use both width and height the image will be cropped from center to that width and height.
if "width" is = to "height" the image will be cropped from image center to make a square sized image.
But it would be handy if you could add another parameter like
crop="top|center|bottom"
or something like that so you could specify where in the image you want the crop to be handled so that it isn’t always in the center.
Anyways, take it for what it’s worth, I could just really use this parameter right now (:
cheers, and thanks for a great plugin.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.