renobird Posted October 14, 2014 Share Posted October 14, 2014 Sweet! Horst, you rock! Giving this a test now — I'll report back soon. Link to comment Share on other sites More sharing options...
Guy Verville Posted October 31, 2014 Share Posted October 31, 2014 (edited) I have the code belows that throws me this error: Error: Exception: Method Pageimages::getThumb does not exist or is not callable in this context (in /Applications/AMPPS/www/tci/wire/core/Wire.php line 349) I am using Processwire 2.5.3. professionnel_photo is an image field and it is set to use the CropImage module. And it works on the admin side. Any idea of what is wrong? <?php $equipe = $pageEquipe->children; foreach($equipe as $membre): ?> <div class="membre"> <div class="photoMembre"> <?php if($membre->professionnel_leader){ image($membre->professionnel_photo->getThumb('leader')); }else{ image($membre->professionnel_photo->getThumb('miniature')); } ?> </div> </div> <?php endforeach ?> Edited October 31, 2014 by kongondo @Guy: Moved this here in this module's support forum where I think it fits better. Hope you don't mind. Link to comment Share on other sites More sharing options...
horst Posted October 31, 2014 Share Posted October 31, 2014 (edited) ah, have to re-read before answer! Please, what code do you use in image() ?? Heureka! Ok, now I have it! $membre->professionnel_photo is a collection (Pageimages), but it should be a single Pageimage! Edited October 31, 2014 by horst 1 Link to comment Share on other sites More sharing options...
Peter Knight Posted November 22, 2014 Share Posted November 22, 2014 Suddenly getting an error on any pages using CropImage Width and height not found for thumb: This is in the admin and not the front end of the site. I never had a CropImage called "thumb" so I assume some of the error message is missing? You'll notice too how the page fields fail to load. After the page title, I had several fields and 2 image fields with CropImage settings. I hadn't edited a CI setting or removed any in between the time the pages/images were working and when they stopped. Is there somewhere in the database, I can find more detail of whats wrong? Link to comment Share on other sites More sharing options...
horst Posted November 22, 2014 Share Posted November 22, 2014 (edited) Do you have updated PW version to 2.5.9 ?? Also switch back to default Admin Theme! just as a test! Edited November 22, 2014 by horst Link to comment Share on other sites More sharing options...
Peter Knight Posted November 22, 2014 Share Posted November 22, 2014 Horst - I solved it by removing my crop image and starting again. Ok, it didn't really solve the problem but I needed to work on those pages. Link to comment Share on other sites More sharing options...
videokid Posted December 12, 2014 Share Posted December 12, 2014 Width and height not found for thumb: I did have the same thing, seems my upload picture had the same width as set in max-upload... coincidence... maybe but changing max upload solved my upload problem... [using 2.5.10]. Link to comment Share on other sites More sharing options...
icreation Posted January 30, 2015 Share Posted January 30, 2015 (edited) Using PW2.5.3 the field seems to work nicely. In the PAGE edit the options are there - nice: .. but this is not working on the front end. I know that I need to do something in the template and have tried the following. <?php echo $page->image->eq(0)->getThumb();?> Can someone help me to get the statement correct for the image in the template? Edited January 30, 2015 by kongondo @icreation, where a module has its own support forum, please use that for support rather than starting a new topic, thanks Link to comment Share on other sites More sharing options...
3fingers Posted January 30, 2015 Share Posted January 30, 2015 From the docs echo $page->cropImages->eq(0)->getThumb('thumbnail'); In your case then echo $page->cropImages->eq(0)->getThumb('square'); // 400*400 thumbnail echo $page->cropImages->eq(0)->getThumb('landscape'); // 400*300 thumbnail echo $page->cropImages->eq(0)->getThumb('portrait'); // 340*453 thumbnail Link to comment Share on other sites More sharing options...
icreation Posted January 30, 2015 Share Posted January 30, 2015 Thanks for coming back to me. I cannot get this to work and just wondered about the syntax for this? The name of my field is sideimage and this would normally be called by <?php echo '<img src="'.$page->sideimage->url." />'; ?> If I change the type of image to cropImage what would be the syntax to call this image? Link to comment Share on other sites More sharing options...
LostKobrakai Posted January 30, 2015 Share Posted January 30, 2015 // getThumb() returns the url of the thumbnail, everything else stays the same. // E. g.: $page->sideimage->description still works. echo '<img src="'.$page->sideimage->getThumb("portrait")." />'; Link to comment Share on other sites More sharing options...
icreation Posted January 30, 2015 Share Posted January 30, 2015 Fantastic thanks! What if I want to allow the client to select from a number of crop options in their admin area (square, portrait and landscape). How would the syntax go so that getThumb() delivers the selected crop? Link to comment Share on other sites More sharing options...
LostKobrakai Posted January 30, 2015 Share Posted January 30, 2015 You would need to implement an extra field, eg. textbox or selectfield, for that selection. That's not implemented in this module. The getThumbs() function just needs to get a string with a valid format name. Link to comment Share on other sites More sharing options...
icreation Posted January 30, 2015 Share Posted January 30, 2015 Got it thanks ! Link to comment Share on other sites More sharing options...
joe_ma Posted February 6, 2015 Share Posted February 6, 2015 I'd like to use this module for cropping images to use in a slider. So I setup a CropImage field that can be used to upload several images. It is called "slider". Now I don't get it working and need a hint. My code for the slider: $imgs = $page->slider; if (count($imgs)) { foreach ($imgs as $img) { echo "<li><img src='{$img->getThumb('slider')->url}' alt='$img->description' /></li>"; } }; Output: no images, only descriptions. Thanks for help. Link to comment Share on other sites More sharing options...
LostKobrakai Posted February 6, 2015 Share Posted February 6, 2015 As written a few posts above: In contrast to the new croppableimage module, thumbnails' getThumb() does not return a new image object, but only the url, so there's no need to call ->url on it. Enabling debug mode should even throw an error on this one. 1 Link to comment Share on other sites More sharing options...
joe_ma Posted February 6, 2015 Share Posted February 6, 2015 Thanks a lot. Works now. Sorry for the nuisance. Link to comment Share on other sites More sharing options...
bernhard Posted February 17, 2015 Share Posted February 17, 2015 with the new dev 2.5.19 there is a problem with this module. i think it must have something to do with the new image handling with retina support: https://processwire.com/blog/posts/new-image-editing-features-2.5.19/ the image is double size on the "wow, that looks great" screen and also on the frontend when displaying via ->getThumb() nevertheless thank you for this great module! Link to comment Share on other sites More sharing options...
joe_ma Posted February 17, 2015 Share Posted February 17, 2015 After moving a site from my local xampp to a live server, I encounter problems with the images upload: even though the red progress bar goes up to 100%, nothing happens afterwards. No thumbnails. And after safeing the page, there are no images at all. I tried to change the module and .htaccess as mentioned above, but got no results. Edit: It turned out, that I had cropping information for landscape images, that exhausted the memory. So the thumbs could not be created. That seemed to have blocked everything. Link to comment Share on other sites More sharing options...
Ovi Posted May 2, 2015 Share Posted May 2, 2015 Hi Apeisa, I've found a bug. When using a cropimage field inside of a repeater field, the description of the image does not save. The puzzling part is that I think it used to at some point, since I have images with descriptions still there in the install. But now I've run into this problem on any install I try (they are all on the same server and I haven't changed the server config). I tried a fresh install of 2.5.2.8 and 2.5.2.9 (dev), as well as 2.5.3 (master) and it also happens on 2.3.0. The bug happens with even just the default install and the Thumbnails modules installed, nothing else, on a clean install. Debug mode is enabled but shows no errors or warnings. Console is clean. Normal image fields' descriptions still do save, but if I switch them to CropImage they stop working. I can give you access to an account on the server if you can't reproduce the bug for some reason, just let me know. Thanks! Link to comment Share on other sites More sharing options...
icreation Posted May 2, 2015 Share Posted May 2, 2015 I can confirm this. When you are inside a croppableimage that is inside a repeater it brings up the modal but the tools and buttons are missing so you can't crop or save. Link to comment Share on other sites More sharing options...
bernhard Posted June 6, 2015 Share Posted June 6, 2015 hey apeisa, i found a bug when using your module with the new 2.6 version (left how it looks like with 2.5.3 which is ok) this makes it impossible to switch between grid/list view making it also impossible to delete images, so that's a serious thing you can use my test-installation from here: http://stuff.zwergo.net/cropbug.zip user admin pw admin! database is in /site/assets/backups/database/test-2.6.1.sql DB name is test page "test" has template "test" with the bug on it. your help would be greatly appreciated Link to comment Share on other sites More sharing options...
Martijn Geerts Posted June 6, 2015 Share Posted June 6, 2015 I don't think it's a bug in this module, have seen it in regular InputfieldImage as well. Can you open the console and look if you see something unexpected ? Link to comment Share on other sites More sharing options...
bernhard Posted June 6, 2015 Share Posted June 6, 2015 hi martijn, it's definitely related to the crop-field. at least in my setup! when i remove the field everything works as expected. when i put it back into the template, the bug appears again. note that it appears only when the field is already populated with images! on first upload it seems to work well. nothing in the console! Link to comment Share on other sites More sharing options...
bfncs Posted June 17, 2015 Share Posted June 17, 2015 I'm getting this right now (right after updating from 2.4.3 to 2.4.5), so it's definitely an outstanding issue. Will have to dig in to see what's going on.. Edit: Just guessing, but could this be related to this commit and the part about "6) Convert Fieldtype modules to load on-demand rather than all at boot"? Looks like after the update when InputfieldCropImage runs, FieldtypeCropImage hasn't been init'd yet.. which obviously results in getThumb() not being available. Anyway, will have to debug more. Edit 2: Whether or not that was the issue, I've solved it locally by making sure that FieldtypeCropImage is loaded with InputfieldCropImage. I can't uninstall the module or try other tricks on this site, as it's already in production -- I'm assuming that Antti or Ryan will dig out the real reason (and fix) for this, but in the meantime this works for me: Index: InputfieldCropImage.module =================================================================== --- InputfieldCropImage.module (revision 7702) +++ InputfieldCropImage.module (working copy) @@ -13,7 +13,8 @@ public function init() { parent::init(); - + // make sure FieldtypeCropImage is loaded + $this->modules->get("FieldtypeCropImage"); //default settings $this->set('thumbSetting', 'thumbnail,100,100'); } Has there ever been a permanent fix for this? I've updated a site from Processwire 2.3.15 to 2.6.1 and FieldtypeCropImage::init() isn't called any more which results in the known Method Pageimage::getThumb does not exist or is not callable in this context problem. I don't see how I can get this working without manually loading the FieldtypeCropImage module everytime before using getThumb() (or making it an autoload module for convenience). Is this generally working for you in 2.6.x? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now