aoepeople / aoe_amazoncdn Goto Github PK
View Code? Open in Web Editor NEWOnepica_ImageCdn fork (only S3 support is left) with some customizations and improvements
Onepica_ImageCdn fork (only S3 support is left) with some customizations and improvements
I'm having an issue where images will get "corrupted" when they're resized.
Reproducing the issue:
media/catalog/product/cache/...
folder on S3.For example:
This image shows a corrupted image
And this image shows the original image (note how this one has red in it)
While creating these two images, I noticed that they're actually both cached... The difference is only the size. The small (corrupted) ones dimensions are 736x460
while the large one is 940x587
.
At first I thought this was an issue of my theme, but I disabled the CDN stuff and tried reuploading a completely different image and the image wasn't corrupted. Re-enabled the CDN stuff and tried again with a new image.. And the image corruption was back.
So somewhere along the lines in this plugin, the image is getting corrupted. Not sure where really.
One other thing I did notice, was that on S3 the original has a Content-Type
of image/png
, while the cached versions are binary/octet-stream
. I've tried changing it to image/jpeg
and that doesn't fix it either.
Have you experienced any similar issues to this?
The problem begins with reading image parameters from the cache table. All the values (with, height, image_type) are type of string.
This causes type comparison fail in Varien_Image_Adapter_Gd2::_getTransparency() method.
In the following condition:
if ((IMAGETYPE_GIF === $fileType) || (IMAGETYPE_PNG === $fileType)) {
...
}
The solution could be casting the values to int in Aoe_AmazonCdn_Model_Varien_Gd2::open() method.
CloudFront will cache a 200 response, even if the object has been removed from the S3 bucket, it seems looking at the actual S3 bucket is necessary to tighten up this are of the code.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.