Closed (fixed)
Project:
ImageCache Actions
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
18 Oct 2017 at 13:52 UTC
Updated:
5 Nov 2017 at 16:14 UTC
Jump to comment: Most recent
Receiving this warning many times in the logs when running PHP7.1 for watermarked image.
Warning: A non-numeric value encountered in imagecache_actions_calculate_offset() (line 376 of /home/mysite/public_html/sites/all/modules/imagecache_actions/utility.inc).
Image preset used:
* Autorotate image based on its EXIF data.
* Scale width 555 (upscaling allowed)
* Overlay (watermark) public://watermark/logo.png, x:right, y:top, alpha:50%, scale:-
Comments
Comment #2
fietserwin- This warning is new in 7.1: http://php.net/manual/en/migration71.other-changes.php#migration71.other-changes.apprise-on-arithmetic-with-invalid-strings.
- The line concerned: $value = $base + ($direction * $value); where it turns out that $value can e.g. be the empty string or a string like "10px".
With a long background in strongly typed languages, I never really liked those "silent conversions" but I am afraid that there are quite a lot in our code base and I have no idea how to find them all. I hope that by running our test set I can catch most of them, but I will have to install PHP 7.1 to start with. Those that remain will then have to be repaired 1 by 1 whenever they get reported.
I will start working on this issue and report back when I have replaced this one and others that I can find with our "test suite".
Comment #4
fietserwinI didn't find many problems. Fixed and committed those that I found. Thanks for reporting.