rosell-dk / webp-convert-and-serve

Convert and serve jpeg/png to webp with PHP (if at all possible)
MIT License
3 stars 1 forks source link

Control error_reporting #8

Open rosell-dk opened 6 years ago

rosell-dk commented 6 years ago

In 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)

rosell-dk commented 6 years ago

I have labelled it a bug, because the behavior has changed (and it shouldn't in a minor version), and it could lead to problems. So this should trigger a 0.4.1 version