czim / file-handling Goto Github PK
View Code? Open in Web Editor NEWFile Handling Helper
License: MIT License
File Handling Helper
License: MIT License
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
!
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.
had a mistyped ->getcode() which already being caught inside a multiple try/catch handlers ends up throwing code 0 regardless of the actual code thrown. This is and has been part of their package for a long time and has gone unnoticed. This code 0 is then treated much like a generic 500, which is not desirable.
As per these failing tests: https://travis-ci.org/czim/file-handling/jobs/477529848 with the following error: exif_read_data(tmp.jpg): Process tag(x0131=Software ): Illegal components(0)
It seems that as of php 7.2 the exif_read_data()
function has a bug or is no longer compatible: https://bugs.php.net/bug.php?id=75785
and here is some further discussion here: https://stackoverflow.com/a/50890651
VideoScreenshotStrategy changes file name which it extract from temporary filename.
file-handling/src/Variant/Strategies/VideoScreenshotStrategy.php
Lines 18 to 20 in f0b9eda
It set it here:
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.
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).
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
);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.