rosell-dk / webp-convert-and-serve Goto Github PK
View Code? Open in Web Editor NEWConvert and serve jpeg/png to webp with PHP (if at all possible)
License: MIT License
Convert and serve jpeg/png to webp with PHP (if at all possible)
License: MIT License
proposing moving from:
convertAndServeImage($source, $destination, $options, $failAction, $criticalFailAction, $debug = false)
to:
convertAndServeImage($source, $destination, $options)
$failAction
and $criticalFailAction
could be part of $options instead$debug
could also be part of options. But perhaps rename it to "display-errors'. Or perhaps, better: removed entirelyIn 0.3, (and in convertAndServeImage), we had these lines:
if ($debug) {
error_reporting(E_ALL);
ini_set('display_errors', 'On');
} else {
ini_set('display_errors', 'Off');
}
These were removed in 0.4
But actually, they made a lot of sense.
If a warning should be issued, while we are producing an image, we will get a corrupt image.
I propose a new option, "display_errors".
If set to "auto", it will behave like above (On, if showing a report, Off, if showing a report). This should be default value.
If set to "dont-mess", nothing will be messed with.
No other values needed (we don't want to advocate that same setting is used for report and image)
WebPConvert 1.1 has added an $logger parameter, which allows insights into the conversion process.
This information should be displayed, when an error occurs, and fail action is set to $REPORT. It should also be displayed, when convertAndReport
is called
It should be possible to set up Travis with functioning converters (cwebp, gd, imagick and perhaps also wpc, if I can figure out a way to only allow travis to use it).
This issue is related to #4.
Simply adding php 5.5 to .travis.yml does not work, because travis tries to install php unit 5.7.
We need php unit 4 in order to test php 5.5 (https://phpunit.de/getting-started/phpunit-4.html)
As Travis is quite flexible, I'm sure we can tweak it to run unit tests with php unit 4 for php 5.5
https://docs.travis-ci.com/user/reference/trusty/
https://docs.travis-ci.com/user/customizing-the-build/
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.