Comments (5)
There is a start of a shell around for that as far is I remember. Need to check my code / branches. I need that feature too but haven't had the time yet to work on it, my Cart plugin has my primary attention.
The idea is to have something like "cake FileStorage.image generate Model.imgConfigAlias" and "cake FileStorage.image delete Model.imgConfigAlias". If you need it urgently you're welcome to contribute. :)
I do not think you want to trigger this processing from a web page, depending on the amount and size of the images it might take a lot of time and there is a good amount of possible errors (memory, disk space) that can happen. A shell is the better place to do this batch processing if you introduced new formats.
from cakephp-file-storage.
This was what exactly what I expected ;-)
I will definitely try to work on this, when I get the time but I also have other projects going that can't wait any longer (always the same).
I really like the idea of using the Cake Shell for this while I'd also appreciate a way to start it from withing a web page, to make it possible to use this with shared hosting.
from cakephp-file-storage.
An issue with this is that it must be easy to extend and flexible. Because the shell must be always be able to find the correct path for the used adapter. For example if you use S3 you need to check the file in the bucket, download the original, resize it locally, delete the original upload the new version, delete the local copy of it.
So basically each adapter / app specific code might use another way to store the images and build the key / path to them.
I think I'm going to provide a way for the standard config that comes with the plugin and uses the local filesystem but will make it flexible so that you can configure it or use params to make it work with other configurations too.
from cakephp-file-storage.
I've pushed a branch that contains a shell to generate and remove image versions. It's still work in progress but worked in a local test for me. I'm also refactoring the Image model to use events to get rid off the weird callback methods it was using before and by this the need to extend the model to change its behavior.
I'm not going to create a controller with a reload-loop, I leave this up to you, but this should be an easy task, just look at the shell and do what it does in a controller with a redirect loop or something else.
from cakephp-file-storage.
This is now done in the develop branch.
There is the ImageVersion shell that will do this task.
For the controller check the shell as I suggested and transfer that to a redirect loop or better into a loop using js on the client side that will do an ajax call per image for the conversion, you'll then also be able to track the progress.
from cakephp-file-storage.
Related Issues (20)
- No versions of jpeg files HOT 4
- Keep a Change Log HOT 2
- Can't save file when creating related model HOT 2
- Upgrading from v1 to v2 HOT 7
- Tag current 2.0 version with next semver tag HOT 1
- How can one add to the list of supported adapter classes? HOT 5
- No image manipulation or correct url paths being returned HOT 2
- updating docs HOT 3
- Todo: Add migration guide from Cake 3 to 4 HOT 2
- updating docs
- Class could be found HOT 4
- Followed the guidelines in documentations server complaints 'Burzum\FileStorage\Event\LocalFileStorageListener' not found HOT 3
- Created a script to upload files to S3 - files uploaded but script throws error The listener `Burzum\FileStorage\Storage\Listener\LocalListener` doesn't allow the `\Gaufrette\Adapter\AwsS3` adapter class! Probably because it can't work with it HOT 4
- cakephp/cakephp 4.0.x dependency issue HOT 7
- Version 4.0 (complete rewrite) HOT 3
- Antipattern showcase
- Link in docs is broken
- Issues with upload for 1:1 HOT 1
- Issues installing via composer HOT 8
- Looking for a new maintainer
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 cakephp-file-storage.