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

garymcginty's avatar
garymcginty
6 posts
17 years ago
garymcginty's avatar garymcginty

{exp:weblog:entries weblog="blog" limit="25"} <div id=”articles_tit”> {title} </div> <div id=”articles_body”> <div id=”thumbs”> {exp:imgsizer:size src="{mainimage}” width=”112” alt=”speed tree” id=”img_speedtree” }</div> <a href=”http://{title_permalink=">{summary} </div> {/exp:weblog:entries}

I am trying this code, but isn’t work. If I open source view I dont see any output for the imgsizer. But if I put, instead the name of my custom field (“{mainimage}”), the complete path for the image, like:http://bbwblog.ali89.ion.ie/imgs/blog/software/speedtree01.jpg, then I can see the thumb. But this is not very helpfull if I to loop thru my 25 last entries.

Any help?

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

You need to have something like this in the field:

image.jpg

You may put other things in the image link like https://ellislab.com/asset/images/team-photo/

Also set the field to Formatting: none

That made it work for me!

       
garymcginty's avatar
garymcginty
6 posts
17 years ago
garymcginty's avatar garymcginty

Thanks for your reply noregt.

This means that Image Sizer doesn’t recognize custom field for the src tag?!

If I want to show in my index page the last 25 entries with image sizer thumbs I have to call the images one by one… 😖 This is more tyring than create the thumbs by myself and place the custom field name(like thumbs) in the publish entrie.

Thats it or I am missing something?

       
garymcginty's avatar
garymcginty
6 posts
17 years ago
garymcginty's avatar garymcginty

Yes I was missing something.

I put the “image.jpg” in my custom field “mainimage” and in the imgsizer tag I put just the name of my field whitout src. This “{mainimage}” instead of this src=”{mainimage}”.

And now is working perfectly.

Many thanks for this plug in. Will save me lot of time…

       
garymcginty's avatar
garymcginty
6 posts
17 years ago
garymcginty's avatar garymcginty

I put the “image.jpg” in my custom field “mainimage” and in the imgsizer tag I put just the name of my field whitout src. This “{mainimage}” instead of this src=”{mainimage}”.

And now is working perfectly.

Many thanks for this plug in. Will save me lot of time…

Still not working, when I put more than 1 post The image sizer stop working.

This should be really simple, no?

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

What do you mean with ‘stops working’?

Does it only show one entry, do you get a white page?

Could you show the code for the plugin as it is now?

       
garymcginty's avatar
garymcginty
6 posts
17 years ago
garymcginty's avatar garymcginty

I manage to work again. But now I have a problem with my jpgs. they are corrupted. they all now became +-80% blue. Even if I put the complete path instead a variable…

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

This seems more of a problem with the way your images are handled on the server. Are they perhaps in colour mode CMYK? Under EE Admin › System Preferences › Image Resizing Preferences you might be able to switch between Image Magick and GD2. That also might help

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

garymcginty

clear the images in your cache directory once the images are cached the plug-in will not try and process them again unless you update the originals

       
matt960's avatar
matt960
16 posts
17 years ago
matt960's avatar matt960

i can’t believe i’ve just found this - amazing work lumis - I think a trip to your tip box could be in order!

The extension is mostly working great for me, though I do have a problem relating to the cache folder:

When the extension creates the folder automatically it’s default owner and group are ‘apache’ and the permissions Octal is ‘755’ - which means the extension cannot write the generated images to the folder and no thumbs are generated.

If I manually create a cache folder with permissions set to 777 - everything works and the images are written to the folder perfectly.

I’m guessing this is more a problem with my server config? To be honest my knowledge of server permissions is pretty limited - I think i’ll go have a read up tonight.

Does anybody know what is causing this problem and how to get the generated cache folder to have the needed permissions?

Thanks in advance

       
mreeves's avatar
mreeves
30 posts
17 years ago
mreeves's avatar mreeves

I am experiencing a problem with square sizing.

The plugin is resizing perfectly when I have not defined the width and height as the same value. When I do resize to a square, the plugin does create the thumbnail in the correct dimensions but it looks awful - as if most of the colour has been removed from the image. Any ideas of what may be causing the problem and how to resolve it?

The image resizing setting in the EE control panel is set to GD2 and I have tried the other options - in case that has any bearing on the situation.

Best regards Martin

       
Qrat's avatar
Qrat
40 posts
17 years ago
Qrat's avatar Qrat

Thank you, lumis fro your plugin

I have field “screen” where I put my images. This field has code

https://ellislab.com/asset/images/team-photo/aperture2.png
https://ellislab.com/asset/images/team-photo/IMG_0225.jpg

I use

{exp:imgsizer:size justurl="yes" {screen} height="100"}
       {sized}
  {/exp:imgsizer:size}

to show thumbnails, but I see only one image Could you tell, how can I resize more than one images in field {screen}

       
matt960's avatar
matt960
16 posts
17 years ago
matt960's avatar matt960

I have done some research regarding the problem i am having where the cache folder generated by the Image Sizer extension is not writable by the script. (post #131 above)

It seems this may have something to do with php ‘safe-mode’ being enabled on my server.

My host is a MediaTemple Shared Server and it seems to get safe mode turned off i have to either upgrade my server package or try some suggested steps involving htaccess and cgi that i don’t yet fully understand and according to my host - may not work anyway.

It seems that EE runs fine on its own with safe-mode enabled. Does anybody know if this particular plugin is written in a way that would require safe mode to be turned off?

Before I go through the expense and time of upgrading my server package I thought I’d ask if anybody knows with any certainty whether this plugin needs safe mode to be off or not. Is anybody running this plugin without problems with safe-mode turned on? (it’s status is listed in phpinfo)

many thanks in advance

EDIT - Fixed! If anybody else has a problem with permissions of folders on a media temple server with php safe mode on - the advice found in this post solved my problem! Simply adding a .htaccess file in the main expression engine folder with this code saved the day.. though my poor php knowledge means I have absolutely no idea how or why 😊

Action php-script /interpreters/php-script 
AddHandler php-script .php AddHandler php-script .php3
       
minimal design's avatar
minimal design
356 posts
17 years ago
minimal design's avatar minimal design

I’m having a problem similar to some other people on here: the plugin doesn’t output anything if I use a custom field in the src attribute but works fine with a hard coded URL to the image file.

ExpressionEngine 1.6.2 - Build: 20080206 imgsizer 1.6.6

I have an image folder with upload directory set to: {site_url}images/artists/ The custom field “picture_uri” content is something like: https://ellislab.com/asset/images/ent-partner-logo/my_image.jpg

And the code in my template (simplified for brevity):

{exp:weblog:entries weblog="artists" category="4" limit="5" orderby="date"}
<div class="artist">
    {picture_uri}
    {exp:imgsizer:size src="{picture_uri}" width="73" alt="{title}" }
</div><!-- .artist -->                    
{/exp:weblog:entries}

You can see I added an extra {picture_uri} to check its output. That part works fine. If I copy/paste the output of the first {picture_uri} and paste it as a static link in place of the “real” {picture_uri}, the plugin works. It creates the image thumbnail in the cache folder and displays it as it supposed to.

When I put back the tag in instead of hard link. The plugin does not output anything at all.

Any idea? I really want to get this plugin working as it does exactly what I need… Thanks!

Update:

ok, so the culprit was that it doesn’t work with {site_url} as part of File Upload Preferences › Edit File Upload Preferences › URL of Upload Directory, it has to be a hard coded URI.

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

yeah you cant pass in a full {exp:imgsizer:size src=" alt="{title}" width="73" /></p> <p>but this will</p> <pre><code>{exp:imgsizer:size src="http://www.domain.com/path/to/your/image.jpg" width="73" alt="{title}"}

@ voodoo6 the plug-in is set to create the directory as 777 but that is done by the user that is running php so it may not always be that depending on how the server is setup. it may be best to go in and manually create the cache DIR

@ mreeves try playing with the unsharpen mask setting or not using unsharpen mask at all it can sometimes create ugly results

       
First 7 8 9 10 11 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.