Giter Site home page Giter Site logo

imagecache's People

Contributors

onigoetz avatar thattomperson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

imagecache's Issues

404 on retina images

Hi,
I like this package a lot, just included it in a first project.

I don't like to use retina.js since it tries to find .@2x images from ALL the images on the website. This results in a huge amount of 404 on every page.

I've been using this little piece of JQuery for years now:

    // hires images
    if (window.devicePixelRatio == 2) {
        var images = $("img.hires");

        // loop through the images and make them hi-res
        for(var i = 0; i < images.length; i++) {

            // create new image name
            var imageType = images[i].src.substr(-4);
            var imageName = images[i].src.substr(0, images[i].src.length - 4);
            imageName += "@2x" + imageType;

            //rename image
            images[i].src = imageName;
        }
    }

It will replace only the images with the class 'hires'. This way I'm in charge of which images can be @2x.
It will never result in a 404 this way.

The stranges thing happens when I use this imagecache package. As soon as browsercaching is ON. I get 404 errors on all the retina images in the console. However, the correct (@2x) images ARE loaded!

I enable browsercache like this (on NGINX):

    location ~* \.(?:ico|css|js|gif|jpe?g|png|woff|ttf|otf|svg|woff2|eot)$ {
        expires 1y;
        add_header Pragma public;
        add_header Cache-Control "public, must-revalidate, proxy-revalidate";
    }

Hope anyone can figure out what is going wrong.

Error installing imagecache on Laravel with Composer

Hi Stéphane, I'm trying to install on Laravel, but I'm running into the following error when I run "composer require onigoetz/imagecache:dev-master":


Failed to download onigoetz/imagecache from source: Failed to execute git checkout "408220918675b34e3575109569f691b76907d47a" && git reset --hard "408220918675b34e3575109569f691b76907d47a"

HEAD is now at 4082209... Drop PHP 5.3 support
error: unable to create file tests/Fixtures/result/scale-40-?.png (Invalid argument)
error: unable to create file tests/Fixtures/result/scale-?-60.png (Invalid argument)
fatal: Could not reset index file to revision '408220918675b34e3575109569f691b76907d47a'.

Now trying to download from dist

  • Installing onigoetz/imagecache (dev-master 4082209)
    Downloading: 100%

    [RuntimeException]

    There was an error extracting the ZIP file. Corrupt file?

Can you please look into this, and let me know how I can install the package?

Laravel Headers are incorrect

on image creation image headers are incorrect
this can be fixed by using $transfer->getHeaders() instead of $transfer->getFormattedHeaders() in the laravel service provider https://github.com/onigoetz/imagecache/blob/master/src/Support/Laravel/ImagecacheServiceProvider.php#L61

HTTP/1.1 200 OK
Host: localhost:8000
Connection: close
X-Powered-By: PHP/5.5.9-1ubuntu4.5
0: Content-Type: image/png
1: Content-Length: 3145
2: Expires: Mon, 02 Feb 2015 04:20:42 GMT
3: Cache-Control: max-age=1209600, private, must-revalidate
4: Last-Modified: Mon, 19 Jan 2015 04:20:42 GMT
5: ETag: 77f3b78e2a9de243f010a93fc3536a01
Cache-Control: no-cache, private
Date: Mon, 19 Jan 2015 04:20:42 GMT
Content-Type: text/html; charset=UTF-8
Set-Cookie: laravel_session=eyJpdiI6InJ6VG9QbVJja3JJWlZjQ2pJTzdOV3c9PSIsInZhbHVlIjoiVTZscllMYkdUWmxnRXl0U05pY09xOUFHU3Nib29tWWJ4Y2YwdUN1N0RzU2VSQzVsdEtJeHhVYmlmUVQzZ3k4MnQySHFMSHVUeGF4cnEyMTNkN3BEaVE9PSIsIm1hYyI6IjA5MmE1NDc0NjUyOTNlMTM5YWFhY2UyMmY1MGVmNjI5ZjMxYmVlYjE3NTZhYzQzMGRjNDhlMDIyNjUxMzdmYjkifQ%3D%3D; expires=Mon, 19-Jan-2015 06:20:42 GMT; Max-Age=7200; path=/; httponly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.