From 11155b5e8ed7222345599c581d01c74e55de5acd Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Wed, 15 Apr 2020 13:23:27 -0500 Subject: [PATCH 1/3] Apparently GD now returns false for empty text We could also return [0, 0, 0, 0, 0, 0, 0, 0] but jpgraph seems to ignore errors, so this is fine --- src/image/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/image/Image.php b/src/image/Image.php index dbf9ad5b..4b011d2f 100644 --- a/src/image/Image.php +++ b/src/image/Image.php @@ -840,7 +840,7 @@ public function imagettfbbox_fixed($size, $angle, $fontfile, $text) // we calculate this manually by getting the bounding box at // angle = 0 and then rotate the bounding box manually $bbox = @imagettfbbox($size, 0, $fontfile, $text); - if ($bbox === false) { + if ($bbox === false && !is_readable($this->font_file)) { Util\JpGraphError::RaiseL(25092, $this->font_file); //("There is either a configuration problem with TrueType or a problem reading font file (".$this->font_file."). Make sure file exists and is in a readable place for the HTTP process. (If 'basedir' restriction is enabled in PHP then the font file must be located in the document root.). It might also be a wrongly installed FreeType library. Try uppgrading to at least FreeType 2.1.13 and recompile GD with the correct setup so it can find the new FT library."); } From 327a947142adce02c183ede6b57b38b3f0abee3d Mon Sep 17 00:00:00 2001 From: zhangsean Date: Sat, 17 Oct 2020 10:56:33 +0800 Subject: [PATCH 2/3] Fix examples_led require errors. --- Examples/examples_led/no_test_ledex1.php | 2 +- Examples/examples_led/no_test_ledex10.php | 4 ++-- Examples/examples_led/no_test_ledex11.php | 4 ++-- Examples/examples_led/no_test_ledex12.php | 4 ++-- Examples/examples_led/no_test_ledex13.php | 4 ++-- Examples/examples_led/no_test_ledex14.php | 4 ++-- Examples/examples_led/no_test_ledex15.php | 4 ++-- Examples/examples_led/no_test_ledex16.php | 4 ++-- Examples/examples_led/no_test_ledex17.php | 4 ++-- Examples/examples_led/no_test_ledex2.php | 4 ++-- Examples/examples_led/no_test_ledex3.php | 3 ++- Examples/examples_led/no_test_ledex4.php | 4 ++-- Examples/examples_led/no_test_ledex5.php | 4 ++-- Examples/examples_led/no_test_ledex6.php | 4 ++-- Examples/examples_led/no_test_ledex7.php | 4 ++-- Examples/examples_led/no_test_ledex8.php | 4 ++-- Examples/examples_led/no_test_ledex9.php | 4 ++-- Examples/examples_led/no_test_ledex_cyrillic.php | 4 ++-- Examples/examples_led/no_test_ledex_cyrillic2.php | 4 ++-- 19 files changed, 37 insertions(+), 36 deletions(-) diff --git a/Examples/examples_led/no_test_ledex1.php b/Examples/examples_led/no_test_ledex1.php index 3c6d2ca4..8ea33ac9 100755 --- a/Examples/examples_led/no_test_ledex1.php +++ b/Examples/examples_led/no_test_ledex1.php @@ -6,7 +6,7 @@ require_once __DIR__ . '/../../src/config.inc.php'; -require_once 'jpgraph/jpgraph_led.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex10.php b/Examples/examples_led/no_test_ledex10.php index 78af85ed..5afbaafe 100755 --- a/Examples/examples_led/no_test_ledex10.php +++ b/Examples/examples_led/no_test_ledex10.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex11.php b/Examples/examples_led/no_test_ledex11.php index 3e06d6f1..d3736bb7 100755 --- a/Examples/examples_led/no_test_ledex11.php +++ b/Examples/examples_led/no_test_ledex11.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex12.php b/Examples/examples_led/no_test_ledex12.php index b70c714b..d92a289a 100755 --- a/Examples/examples_led/no_test_ledex12.php +++ b/Examples/examples_led/no_test_ledex12.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex13.php b/Examples/examples_led/no_test_ledex13.php index 343fa29a..50838090 100755 --- a/Examples/examples_led/no_test_ledex13.php +++ b/Examples/examples_led/no_test_ledex13.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex14.php b/Examples/examples_led/no_test_ledex14.php index 45f3a95b..6819202c 100755 --- a/Examples/examples_led/no_test_ledex14.php +++ b/Examples/examples_led/no_test_ledex14.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex15.php b/Examples/examples_led/no_test_ledex15.php index 9afb71f1..985ddfb9 100755 --- a/Examples/examples_led/no_test_ledex15.php +++ b/Examples/examples_led/no_test_ledex15.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex16.php b/Examples/examples_led/no_test_ledex16.php index 94c91fee..05258b7a 100755 --- a/Examples/examples_led/no_test_ledex16.php +++ b/Examples/examples_led/no_test_ledex16.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex17.php b/Examples/examples_led/no_test_ledex17.php index 27dcde17..316294d0 100755 --- a/Examples/examples_led/no_test_ledex17.php +++ b/Examples/examples_led/no_test_ledex17.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex2.php b/Examples/examples_led/no_test_ledex2.php index 03ffb073..e0d14d7a 100755 --- a/Examples/examples_led/no_test_ledex2.php +++ b/Examples/examples_led/no_test_ledex2.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex3.php b/Examples/examples_led/no_test_ledex3.php index 978e70a4..5381f856 100755 --- a/Examples/examples_led/no_test_ledex3.php +++ b/Examples/examples_led/no_test_ledex3.php @@ -4,9 +4,10 @@ * JPGraph v4.0.3 */ +use Amenadiel\JpGraph\Image\DigitalLED74; + require_once __DIR__ . '/../../src/config.inc.php'; -require_once 'jpgraph/jpgraph_led.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex4.php b/Examples/examples_led/no_test_ledex4.php index 27492681..e9bd1170 100755 --- a/Examples/examples_led/no_test_ledex4.php +++ b/Examples/examples_led/no_test_ledex4.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels. Change to 5 and slghtly smaller margin $led = new DigitalLED74(6); diff --git a/Examples/examples_led/no_test_ledex5.php b/Examples/examples_led/no_test_ledex5.php index 0216466f..a3fc6c74 100755 --- a/Examples/examples_led/no_test_ledex5.php +++ b/Examples/examples_led/no_test_ledex5.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex6.php b/Examples/examples_led/no_test_ledex6.php index a05ca86e..f7d4bc5d 100755 --- a/Examples/examples_led/no_test_ledex6.php +++ b/Examples/examples_led/no_test_ledex6.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex7.php b/Examples/examples_led/no_test_ledex7.php index adeb40fa..706a952f 100755 --- a/Examples/examples_led/no_test_ledex7.php +++ b/Examples/examples_led/no_test_ledex7.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex8.php b/Examples/examples_led/no_test_ledex8.php index b690328d..ed38ee8b 100755 --- a/Examples/examples_led/no_test_ledex8.php +++ b/Examples/examples_led/no_test_ledex8.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex9.php b/Examples/examples_led/no_test_ledex9.php index c96218bc..a9159696 100755 --- a/Examples/examples_led/no_test_ledex9.php +++ b/Examples/examples_led/no_test_ledex9.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels $led = new DigitalLED74(); diff --git a/Examples/examples_led/no_test_ledex_cyrillic.php b/Examples/examples_led/no_test_ledex_cyrillic.php index 9fb0215d..6e46abc6 100755 --- a/Examples/examples_led/no_test_ledex_cyrillic.php +++ b/Examples/examples_led/no_test_ledex_cyrillic.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels. Change to 5 and slghtly smaller margin $led = new DigitalLED74(3); diff --git a/Examples/examples_led/no_test_ledex_cyrillic2.php b/Examples/examples_led/no_test_ledex_cyrillic2.php index 92e2a014..46037162 100755 --- a/Examples/examples_led/no_test_ledex_cyrillic2.php +++ b/Examples/examples_led/no_test_ledex_cyrillic2.php @@ -4,9 +4,9 @@ * JPGraph v4.0.3 */ -require_once __DIR__ . '/../../src/config.inc.php'; +use Amenadiel\JpGraph\Image\DigitalLED74; -require_once 'jpgraph/jpgraph_led.php'; +require_once __DIR__ . '/../../src/config.inc.php'; // By default each "LED" circle has a radius of 3 pixels. Change to 5 and slghtly smaller margin $led = new DigitalLED74(3); From fc4ae4a142786ffbad4db8af2c2677e1ecafff91 Mon Sep 17 00:00:00 2001 From: Felipe Figueroa Date: Sun, 25 Apr 2021 17:11:06 -0400 Subject: [PATCH 3/3] ignoring vscode folder --- .gitignore | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.gitignore b/.gitignore index e4251927..897c71ac 100644 --- a/.gitignore +++ b/.gitignore @@ -19,9 +19,27 @@ nbproject .pmd.log psalm.xml # ignore huge fonts +.churn.yml +.php_cs.cache +.phpcs.config.xml +.phpmd.xml +.pmd.log +psalm.xml +# ignore huge fonts tests/_output/coverage Examples/assets/bkai00mp.ttf Examples/assets/simsun.ttc src/fonts/bkai00mp.ttf src/fonts/simsun.ttc + +*.code-workspace +.build + +tools +.phive +.vscode + +.phpunit.result.cache +template.php +