Giter Club home page Giter Club logo

file-handling's People

Contributors

austenc avatar cibsmart avatar czim avatar kimchirichie avatar kyranb avatar progm avatar st3ffgv4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

file-handling's Issues

Add a video strategy: VideoScreenshotStrategy

This is already referred to in the WIP documentation, but has not been set up yet.

This will require a sensible approach to configuring the required ffprobe/ffpmeg tools, as well as configuration options of how what frame from the timeline to pick, and what names to save them as.

It won't be easy to take multiple screenshots with this approach, since each variant strategy will return one file to be stored under the variant name. However, it will be possible to simply name a bunch of variants with the same strategy (and different settings) to create some screenshots.

This will have to be thorougly tested with the changing extensions: the source will be a .mp4, for instance, and the output would have to be a .jpg!

Add a before/after hook approach

It should be possible to easily hook into file handling and variant processing, adding your own callbacks or the like. Will have to consider whether to include this in the base classes, or extend them instead.

VideoScreenshotStrategy changes file name

VideoScreenshotStrategy changes file name which it extract from temporary filename.

$path = $this->file->path();
$imageName = pathinfo($path, PATHINFO_FILENAME) . '.jpg';

It set it here:

$this->file->setName($imageName);

This causes breakage in laravel-paperclip which seems to assume all variant have the same name, but may have different extension. So getting the url of the screenshot, something like $model->video->url('screenshot') resulting in a url with the original filename which does not exist.

Changing line 20 to something like $imageName = pathinfo($this->file->name(), PATHINFO_FILENAME) . '.jpg';. Fixes the issue.

Garbage collection support: track temporary files to clean up in strategies

Temporary files created for strategy processing are not automatically deleted.

This package needs to offer the means to handle garbage collection for specific files created, both by default and added on the fly.

The aim is to at least provide clients that use this package with a list of 'garbage' files that should be cleaned up after processing is done for each file (and all its variants).

Bug in StorableFileFactory.php

The exception thrown on line 171 has reference to '->getcode' which should be '->getCode'.
This is causing this exception to always throw a code 0

throw new CouldNotRetrieveRemoteFileException(
    "Could not retrieve file from '{$url}'",
    $e->getcode(), // bug here
    $e
);

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.