Git Product home page Git Product logo

Comments (7)

avalanche123 avatar avalanche123 commented on August 24, 2024

you are correct, I don't believe that caching using a filter is possible, nor that it should be done that way. I can help you implement your caching if something necessary for that is missing in the library.

from imagine.

burzum avatar burzum commented on August 24, 2024

It would be nice to hear your idea about caching image versions. To be able to cache them properly I'll need to know the options applied to the image operation so that I can check if an image created based on these operations was already created or not. I can simply wrap Imagine in another class that does that but I think it would be nice if Imagine would provide an interface for that somehow.

from imagine.

avalanche123 avatar avalanche123 commented on August 24, 2024

You could have a CachedImage class, that is a ImageInterface proxy. Then you'd interact with it like with a regular image and it would do cache lookups and population. Imagine already is interfaced so implementing a proxy shouldn't be a problem.

from imagine.

burzum avatar burzum commented on August 24, 2024

Ok sounds like a good solution I'll check it out as soon as I have time for this task again, thank you. You might want to update the manual with a chapter about how to cache images because I think this is a common task when dealing with images.

from imagine.

krnlde avatar krnlde commented on August 24, 2024

@burzum are there any news relating your caching feature? I'm interested in this too. @avalanche123 I think a CachedImage class in the core would be very useful, because no one wants to do expensive computations like reflections on every reload unless the source image or source data for charts have changed - that's simply not necessary.

from imagine.

burzum avatar burzum commented on August 24, 2024

@krnlde No, I've solved this on app level using a storage engine and this method https://github.com/CakeDC/Imagine/blob/master/Model/Behavior/ImagineBehavior.php#L88 to cache the images. I'm working on a private project and might write a blog article in a few weeks about it including the code as a follow up to this one here http://cakedc.com/florian_kraemer/2012/02/03/image-saving-and-processing-for-high-traffic-sites

But I still wish imagine would provide some kind of interface like paramsAsFilestring() and a way to use your custom storage engine with it.

from imagine.

krnlde avatar krnlde commented on August 24, 2024

Thanks @burzum !

+1 for the interface. If that is implemented I could use Assetic for caching, which would be awesome!

from imagine.

Related Issues (20)

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.