Coder Social home page Coder Social logo

Comments (5)

burzum avatar burzum commented on May 18, 2024

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.

bfncs avatar bfncs commented on May 18, 2024

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.

burzum avatar burzum commented on May 18, 2024

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.

burzum avatar burzum commented on May 18, 2024

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.

burzum avatar burzum commented on May 18, 2024

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)

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.