Drupal images issue after enabling cache - image

As much as 75% of images are not loading on my Drupal 7 website. The images in the public folder are being overwritten/renamed with number extensions (Original was: myimage.jpg but is replaced with myimage_0.jpg or myimage_1.jpg, etc). This breaks the image links. Both the original image and the styled version have this same issue.
When editing the node or the view, all the images are visible. But after saving, the majority of images are not visible and link to a non-existent renamed image file.
I thought it might be permissions-related. The images folders are 755. Maybe cache-based problem? Although the problem is not corrected when flushing all cache. I do not have imagecache but do have all performance cache enabled, then installed Boost to increase site performance due to slow loading time.
Is there a way to prevent Drupal from continually renaming/overwriting the original image files or other solution?

What action are you doing to cause this? As I understand it Drupal will created the image-0.jpg file if image.jpg already exist. That's a normal behavior.

Related

How to make a "lock" on image that when downloaded will corrupt it?

With intellectual property becoming a harder and harder area to protect with copyright, one particular area I have been thinking a lot about is images like .jps and .png
I was wondering if there is any way to make a mini "bomb" per se that when an image is uploaded to a website, nothing happens, it's perfectly fine and stays there but when downloaded by someone other than the original uploader, the .jpg or .png corrupts itself and cannot be viewed.
I have tried to research the topic but all I am able to find is how to's on how to fix corrupted images or files.
TL;DR
When an image file is downloaded from the host website the image corrupts itself from being viewed.

Magento: updated product's image doesn't appear in frontend

I opened a product, deleted it's images and uploaded other 2 instead. They appeared in backend.
I refreshed the cache, deleted the cache of images in System=>Cache Management. I deleted cache of images in media/catalog/product/cache manually. I deleted the cache in var/cache, deleted the cache in var/minifycache (I have Fooman Speedster), updated indexes in index management. I deleted the cache in my browser.
Finally, the previous images still were present. WTF? I hit all the delete/refresh-buttons again and again, 10 times, I deleted all the possible and impossible caches manually from a file system. Result: the new images didn't appear.
I got very angry after 2 hours of trying.
I deleted those old images from the file system.
The new images did't appear, now I have a default image of Magento for a product.
I tried to access the new images directly (e.g. http://mysite.com/media/catalog/products/o/1.jpg), and the images are loaded and found without problems.
The new images are showed in backend fine.
What the hell is happening? How to get rid of it and, finally, to go bad at 5 a.m.??? Thank everybody for helping me.
My only advice is to double and triple check that you've flush all caches possible (Magento Cache, System Cache, and all 8 caches along with media cache). If you're using Zend Full Page cache, empty that too. Go to /var/cache and delete everything in here and do the same in var/sessions (if you're storing sessions in the file system and not the database).
If all of that fails try using a different browser that you have yet to view the site on. If that fails try uploading a fresh copy of your version of magento, replacing all the core files. I've seen crazy things happen with Magento and a upload of a clean copy fixes problems for whatever reason. Hope this helps!
Just ran into this problem myself. Don't forget to look externally as well, such as in the case of varnish/pagespeed/some CDN, and pay close attention to the URLs. I spent about an hour scratching my head wondering why it wasn't working when I was purging the wrong thing (www.example.com instead of media.example.com).
just try on command
php bin/magento catalog:image:resize
then
reindex command
your system will work perfectly.

Magento product zoom files

Can someone please tell me what are the Javascript files for default Magento Product Zoom extension. On my site its not working and seems I am missing some files.
please reply.
That depends of your magento version:
Community edition have it's zoom stored in js/varien/product.js (Product.Zoom object)
Enterprise one in /skin/frontend/enterprise/default/js/jqzoom (additional outdated jquery zoom)
I believer that your scripts are loaded fine.
The problem can be in "image size" vs "image-frame" size.
If product image is less or equal then dimensions of an html element (set in css for CE), then zoom is not performed (no use of extra large image of bad quality).
So check size of your uploaded image. Or just upload really huge one to resolve your issue.
The zoom files are in the folder skin/frontend///js/
There you can see the js files or folders (jqzoom).

Image display/cut off issue when using Vagrant for HAML/SASS development

I'm making HAML/SASS changes for a Rails app which I'm running locally using a Vagrant/VirtualBox VM on Mac OSX (Snow Leopard), and I keep encountering a really odd issue whenever I make changes to an image referenced in any of the HAML/SASS files.
Here's an example of what happens:
I open a local Rails app page in my browser and all images are displaying correctly
I re-size an image (using Gimp) to make it smaller and save changes
I refresh the page to see the changes and the original image is still showing, but with the bottom cut off in proportion to how much smaller I made the image
I remove the image file from the directory and hard refresh the page to see what happens.
Sometimes the original cut-off image is still there, sometimes it disappears and I just see the missing image path icon
I move the image file back into the directory to try and force it to pick up the re-sizing
Sometimes this works first time, sometimes I have to do it 3 or 4 times before I see the correctly-sized image
Sometimes I see the old cut off image re-appear even after I have refreshed the page and seen no image!
The same issue seems to occur if I am making other changes to the image file (e.g. if I'm saving an entirely new image with the same file name). Apart from this image issue, all edits to HAML/SASS files work, and I can instantaneously see my changes.
I thought it might be some sort of browser rendering/caching issue, but similar issues occur in Firefox and Chrome. If I use Firebug I can sometimes see that the correct file is being picked up but it's not showing in the page itself.
I can only think that this has something to do with Vagrant. The only thing that is guaranteed to fix it entirely is restrating the Vagrant box, but that takes a long time.
I realise that this may not be a simple problem, as it may have something to do with our Rails app and configuration of Vagrant/VirtualBox, but I just thought I'd post the issue here in case anyone else has had similar issues.
Thanks!
What you're probably seeing is an issue that the VirtualBox shared folder filesystem has along with the sendfile syscall. You need to disable the use of sendfile on your webserver if you're serving files from a VirtualBox shared folder. Doing this is easy:
In Apache, add this to your configuration: EnableSendfile off
In Nginx, add this to your configuration: sendfile off;

Drupal image upload issues

When uploading images in Drupal I have continuously encounter an issue with the physical size of the image - not the size of the file.
Let me explain further. An image could be a small file size (under the restrictions) but be larger than average on the screen. These images fail to upload in Drupal across all sites that I have built using the CMS.
Has this happened for anyone else? Any ideas how I could get around this?
I tend to use filefield and imagefield rather than the image module, because I think they give better flexibility.
You could also try imagecache, which gives you a lot of control over the uploaded images

Resources