Problem with cached images with the Designer Content add-on
Permalink
I've been asking around on the add-on forums, but it seems like the developer has been away for a bit, and I would just like to get this fixed, because it seems like it would be a simple solution, I just don't know what it is.
When you have an image block (created with the Designer Content add-on), and you select an image for it, it uses a cached version of that image. Normally this is fine, but we've been replacing some of the images on our site with larger, better quality versions, and now whenever we insert one, and try sizing it down to a much smaller size, it crops the edges slightly, which cuts off some important parts.
Does anyone know how to change it so it doesn't call on the cached version of the image?
Thanks
When you have an image block (created with the Designer Content add-on), and you select an image for it, it uses a cached version of that image. Normally this is fine, but we've been replacing some of the images on our site with larger, better quality versions, and now whenever we insert one, and try sizing it down to a much smaller size, it crops the edges slightly, which cuts off some important parts.
Does anyone know how to change it so it doesn't call on the cached version of the image?
Thanks
Hello mnakalay,
Sorry about that, I should have explained further.
I have a block that basically adds book information. We add a book image, book title, book author, etc. When I created the block, I inserted static HTML around the image block that had a css class, which I put height and width parameters into.
The reason I need it to call on the original image is because this only started happening once we started replacing old images with larger, higher quality versions. We are using the Concrete5 "Replace" method to replace the images. Once we did that, it started cropping the edges. If we use the replace method again, and put the old image back in, it went back to normal. We tried to see if it was the image that was causing the problem (which seems like it is, but I don't know how), but they are both in the same file format (.png), other than that the only difference is that the other one is bigger.
Hope this clarifies. :)
Sorry about that, I should have explained further.
I have a block that basically adds book information. We add a book image, book title, book author, etc. When I created the block, I inserted static HTML around the image block that had a css class, which I put height and width parameters into.
The reason I need it to call on the original image is because this only started happening once we started replacing old images with larger, higher quality versions. We are using the Concrete5 "Replace" method to replace the images. Once we did that, it started cropping the edges. If we use the replace method again, and put the old image back in, it went back to normal. We tried to see if it was the image that was causing the problem (which seems like it is, but I don't know how), but they are both in the same file format (.png), other than that the only difference is that the other one is bigger.
Hope this clarifies. :)
Just to clarify, once Designer Content has built and saved the custom block, it has no further interaction with the block. What you are dealing with now is just the core editing behavior. Does this happen when you replace images in the core Image block?
This might be related to caching so always turn off all your concrete5 caching when editing a site and clear your browser(s) cache as well. I have all my browser caching turned off and all concrete5 caching turned off as well while building/editing a site.
This might be related to caching so always turn off all your concrete5 caching when editing a site and clear your browser(s) cache as well. I have all my browser caching turned off and all concrete5 caching turned off as well while building/editing a site.
Sounds more like an html/css problem. Would you have a link to the website?
You can see an example of it athttp://gkmnetsite.godskingdom.org/test-page...
Now I'm even more confused. The default Concrete5 Image block also points to the cached file, but it doesn't display in the same way. When I use F12 (on Chromium Browsers), and manually edit the default image block's class to the same class as the other one, the dimensions get edited, but it doesn't do the cropping thing.
Not sure what's going on.
Now I'm even more confused. The default Concrete5 Image block also points to the cached file, but it doesn't display in the same way. When I use F12 (on Chromium Browsers), and manually edit the default image block's class to the same class as the other one, the dimensions get edited, but it doesn't do the cropping thing.
Not sure what's going on.
The 2 blocks are not pointing at the same file, lok at the files names, they are different.
I am now convinved your Designer COntent block is set to crop the picture to have it match the size.
If you check the designer content block the size of the picture is 80x120 while the other one is 73x120. My guess is that you set it to be 80x120 and the actual proportions of the original image doesn't allow to have that exact size without cropping, that's why Designer Content is cropping so you get the exact size and the other one is only resizing so you're getting 73x120.
Look in your Designer Content block in the controller.php file, find the function
You will find something like
In which field_1 will have the name of your image field and 80 and 120 will have the values of whatever size you set.
If I am right, the value afte rthe sizes is set to true , in which case just modify the final true to false so it doesn't crop anymore.
I am now convinved your Designer COntent block is set to crop the picture to have it match the size.
If you check the designer content block the size of the picture is 80x120 while the other one is 73x120. My guess is that you set it to be 80x120 and the actual proportions of the original image doesn't allow to have that exact size without cropping, that's why Designer Content is cropping so you get the exact size and the other one is only resizing so you're getting 73x120.
Look in your Designer Content block in the controller.php file, find the function
public function view()
You will find something like
$this->set('field_1_image', (empty($this->field_1_image_fID) ? null : $this->get_image_object($this->field_1_image_fID, 80, 120, true)));
In which field_1 will have the name of your image field and 80 and 120 will have the values of whatever size you set.
If I am right, the value afte rthe sizes is set to true , in which case just modify the final true to false so it doesn't crop anymore.
Awesome, that seems to have fixed the issue!
It must have been a setting that I set when creating the block, and I didn't realize it.
Thanks for your help, I really appreciate it. :)
It must have been a setting that I set when creating the block, and I didn't realize it.
Thanks for your help, I really appreciate it. :)
My pleasure :)
I had exactly the same problem and spent AGES trying to sort it with no success. Again I have no recollection of setting the height and width of the image in Designer Content, and am surprised that I did so as I never have before, but sure enough it was there in the controller.php. Should have looked here earlier! Thanks so much everyone, will remember this in future.
I am not sure I understand. Are you using Designer Content resizing feature or are you specifying a size in css or what? Als it doesn't seem to have anything to do with cache.
I am not sure but it sounds as if, when designing the block in Designer Content, you asked for the picture to be resized and cropped to match final size, instead of just resizing.
Your solution would be to redo the block, it will take you 5 minutes of change the code manually so it only resizes and stops croping