Comments (7)
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.
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.
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.
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.
@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.
@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.
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)
- Deprecation messages in symfony 5.4 HOT 13
- Split getSupportedFormats into getSupportedInputFormats and getSupportedOutputFormats HOT 2
- Release a PHP 8.1 version HOT 3
- Segmentation fault with GD on 1.3.1 HOT 24
- Support for CMYK ? HOT 11
- curl error: 1409442E:SSL routines:ssl3_read_bytes:tlsv1 alert protocol version HOT 9
- Unable to open remote jpg image HOT 1
- Issue reading GDImage object using \Imagine\Gd\Imagine read() method HOT 3
- Is there an inverse to getGdResource() HOT 7
- Gd\Drawer -> ellipse
- Why does Point class reject negative values...? HOT 3
- Hello, is this image library still being updated? I want him to be a replacement for intervention, because intervention is no longer updated. HOT 1
- `getImageAlphaChannel` returns incorrect value HOT 3
- Incorrect formula to calculate the linnear position. HOT 1
- Update min required PHP version and fix deprecation warnings HOT 3
- Error when file is coming from temp directory: Creating an image in "C:\Users\...\Temp\phpA6B2.tmp" format is not supported, please use one of the following formats: HOT 7
- Feature request: Add support for "setOption('jpeg:size', '800x800');"
- vulnerable libraries (jQuery) HOT 4
- Memory limit not throw new RuntimeException
- Saving Lossless Webp? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagine.