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

vladyn's avatar
vladyn
176 posts
16 years ago
vladyn's avatar vladyn
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 9000 bytes) in /home/design4s/public_html/ee/d4s/plugins/pi.imgsizer.php on line 533

I’ve got that Error message

       
GDmac - expocom's avatar
GDmac - expocom
350 posts
16 years ago
GDmac - expocom's avatar GDmac - expocom

Feature Request: It would be very nice to have the ability to crop the image instead of resizing it. (see attached image). The cropped version could be used on the front-page and the full image on the single entry page.

       
vladyn's avatar
vladyn
176 posts
16 years ago
vladyn's avatar vladyn

yeah, but if you have image width 700 and I need a thumb of 100x100 it going to be unrecognized - in this example it will be not so associative if I should to crop only the briefcase…

       
leadsuccess's avatar
leadsuccess
408 posts
16 years ago
leadsuccess's avatar leadsuccess

@kreate Not sure if this is the issue but it’s good to drop this in every once in a while.

If you have issues with the image not being created, meaning the image not resizing into the cache file here is what I found.

If I create the directory (eg. uploads/newsphotos/) with 777 permissions and then setup things in the “file upload” section in the CP, that is all fine, what happens is the cache folder in the newsphotos directory is auto created but ownership of the directory is wrong (on my server anyway), the plug-in tries to create the downsized image but is not the owner of that directory (bare with me). Even though permissions are set to 777 for /cache you need to delete that directory and create it yourself, plus permission 777. That will fix any odd issues with the file not being created. Now when you create the directory /newsphotos also create the /cache folder inside it with 777 permissions.

Maybe I am the only one this happens to but just in case it may save someone time.

       
GDmac - expocom's avatar
GDmac - expocom
350 posts
16 years ago
GDmac - expocom's avatar GDmac - expocom

@vladyn, you wouldn’t have to crop if you don’t need to, or want to. It would be a great extra ‘option’ if you could choose crop=” in some cases, like for a ‘who is who’ list-page.

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

Hi All

I have updated imagesizer to version 2.5. Hopefully fixing many of the issues reported in this thread. Or giving you the flexibility to adjust the file locations to meet your needs and or allowing you to fix some issues with custom EE setups.

My hopes are that imagesizers functionality is built into EE 2.0 so I will not be adding any new features until I get my hands on a dev release of 2.0 or get a definitive anser to any image manipulation features in EE2.0. But i will try and help out when I can with any bugs found in this version.

There are some pretty big behind the scenes changes in this version so if you are already using this plug-in and update to 2.5 please make a backup of the plug-in you are using in case of any catastrophe. 2.5’s params should be 100% backwards compatible with older versions.

updates in 2.5 * the cache directory’s are now in one folder and are no longer under each folder containing the images * the cache directory can be set optionally using the base_cache param * http root can now be set optionally using the base_path param * remote images can be fetched and cached locally for a set amount of time buy passing a full url in the src= and turning on the remote param (lightly tested). * debugging is moved to the template debugging. Turn this on in the EE CP under Output and Debugging Preferences * Code cleanup ect.

I have only tested this using EE 1.6.7 running on PHP Version 5.2.6 with GD2.0.34 I cant say for sure if it will work on anything less but you are welcome to try and report back on what you find out.

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

@noregt I was just looking back over forum post here and saw your problem with using the tags.

i am not sure if this is a base problem with EE but more than likely the way i did the output code taking into account single tags and/or paired tags. But for some reason there are problems with using a paired tag and then using a single tag in the same template. If you need to use both put one or the other in an embed. But really recommend to stay with one or the other.

–edit– @noregt Also sorry about the confusion with cropping. I have tried to clear up some of the language used when explaining cropping in the doc’s with 2.5

       
International Polar Foundation's avatar
International Polar Foundation
14 posts
16 years ago
International Polar Foundation's avatar International Polar Foundation

Hello Lumis,

Thank you for this wonderful plugin. Using it all the time. I tried to upgrade to the 2.5 version but no output at all (using in in cunjunction with nGen File but that’s not the probelm since I tested it with a manually entered image path too).

I am using very simple code and I do not use tag and tag pair in the same template.

{exp:imgsizer:size src="{blogpost_image}" width="200" alt="{blogpost_image_legend} - © {blogpost_image_copyright}"}

EE: ExpressionEngine Core 1.6.7 build 20090320 PHP: Version 5.2.6 GD: bundled (2.0.34 compatible) [WAMP basic install]

I reverted back to the old version of the plugin and everything works as expected.

Just thought I would let you know. Any idea ?

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

it would be helpful if you could post the error that is output in the template debugging.

       
International Polar Foundation's avatar
International Polar Foundation
14 posts
16 years ago
International Polar Foundation's avatar International Polar Foundation

Sorry for the delay. Here is what I get with template debugging on. Looks the file path with th new plugin version is not correct.

New plugin

(0.287921) Tag: {exp:imgsizer:size src="/blog/uploads/blog_images/bee.jpg" width="200"} (0.288578) Closing Tag Found (0.288765) Processing Tags (0.288851) Plugin Tag: Imgsizer/size (0.288898) Including Files for Tag and Modules (0.363995) Beginning Final Tag Data Processing (0.364083) Calling Class/Method: Imgsizer/size (0.364562) -> Class Called: Imgsizer (0.364623) -> Method Called: size (0.366660) Error: G:/weblocal/www/blog/blog/uploads/blog_images/bee.jpg image is not readable or does not exist (0.366870) Returning No Results Content (0.366922) -> Data Returned (0.367033) - End Tag Processing

There is a path problem here (although my upload folder settings are ok I think). </blog/blog> is not correct. The url should read <G:/weblocal/www/blog/uploads/blog_images/bee.jpg>. Some duplication going on here.

Here is what I have got in my file upload preferences (moved my upload folder to website root).

G:/weblocal/www/blog/uploads/blog_images/

Old plugin

(0.285600) Tag: {exp:imgsizer:size src="/blog/uploads/blog_images/bee.jpg" width="200"} (0.286205) Closing Tag Found (0.286388) Processing Tags (0.286470) Plugin Tag: Imgsizer/size (0.286518) Including Files for Tag and Modules (0.365178) Beginning Final Tag Data Processing (0.365271) Calling Class/Method: Imgsizer/size (0.365739) -> Class Called: Imgsizer (0.365801) -> Method Called: size (0.371297) -> Data Returned (0.371426) - End Tag Processing -
       
jschutt's avatar
jschutt
452 posts
16 years ago
jschutt's avatar jschutt

I am having the same issue with a directory being doubled…

(0.188964) Error: /home/XXXXX/public_html/awakenings/awakenings/images/photo_gallery/DSC_7205.JPG image is not readable or does not exist

The “awakenings” directory isn’t supposed to appear twice.

Thanks!

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

Strange I could not duplicate that problem.

What happens is it gets your base_path from ee’s “set_realpath(“./”)” function and combines that with the source param to create your absolute system path to the image file. If anyone knows a better way please let me know.

alternatively in version 2.5+ you can set the base path yourself to your web root.

{exp:imgsizer:size base_path="/home/XXXXX/public_html/awakenings/" src="/images/photo_gallery/DSC_7205.JPG" height="150"}

The benefit for setting base_path yourself is that you could use this with cache_path to fetch images outside of your web-root and then cache them into your web-root. e.g. if you had multiple domains and wanted to share a single image repository across domains.

I updated the version to 2.5.2 with a few added catches to try and weed out any potential problems with this process but without having these issues on my setup it is hard to debug them.

—edit— never mind this was just to problematic depending on peoples server configurations, so i just reverted back to the old way Image Sizer was finding the base_path by default you can still override this by setting base_path= as a param.

give version 2.5.3 a try if you want

       
jschutt's avatar
jschutt
452 posts
16 years ago
jschutt's avatar jschutt

Thanks David!

I’ll take a look at this later and let you know how it works. Great work!

Jesse

       
International Polar Foundation's avatar
International Polar Foundation
14 posts
16 years ago
International Polar Foundation's avatar International Polar Foundation

Hello David,

The duplication problem has gone away but there still seems to be a problem on my install:

When specifiying the base-path manually it’s ok with the 2.5.3 version. The problem with that one is that I have to edit all my templates when going from the dev website (local) to the production website (online).

{exp:imgsizer:size base_path="G:/weblocal/www/" src="{blogpost_image}" width="200" alt="{blogpost_image_legend} - © {blogpost_image_copyright}"}

When not, I get this error

(0.409460) Beginning Final Tag Data Processing (0.409702) Calling Class/Method: Imgsizer/size (0.409934) -> Class Called: Imgsizer (0.409992) -> Method Called: size (0.410143) /blog/uploads/blog_images/bee.jpg (0.410266) /G:/weblocal/www/ (0.410905) Error: /G:/weblocal/www/blog/uploads/blog_images/bee.jpg image is not readable or does not exist (0.410976) Returning No Results Content (0.411025) -> Data Returned (0.411135) - End Tag Processing

No more directory duplication (thanks for this !!!) but the backslash in front needs to go, methink. My Server Path to Upload Directory is specified as follow:

G:/weblocal/www/blog/uploads/blog_images/

Thank you again for this super useful plugin and for looking into this.

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

this should be fixed now..

       
First 26 27 28 29 30 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.