Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

NEW GDBackend can save interlaced image

Disabled by default use config GDBackend.image_interlace: 1 to enable
  • Loading branch information...
commit 19928ff5e8a1dbb083b12bb019d3cbf8bf964ac7 1 parent f532b84
@colymba colymba authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 filesystem/GD.php
View
11 filesystem/GD.php
@@ -7,6 +7,7 @@
class GDBackend extends Object implements Image_Backend {
protected $gd, $width, $height;
protected $quality;
+ protected $interlace;
/**
* @config
@@ -15,6 +16,12 @@ class GDBackend extends Object implements Image_Backend {
private static $default_quality = 75;
/**
+ * @config
+ * @var integer
+ */
+ private static $image_interlace = 0;
+
+ /**
* Set the default image quality.
*
* @deprecated 3.2 Use the "GDBackend.default_quality" config setting instead
@@ -56,6 +63,7 @@ public function __construct($filename = null) {
parent::__construct();
$this->quality = $this->config()->default_quality;
+ $this->interlace = $this->config()->image_interlace;
}
public function setImageResource($resource) {
@@ -455,6 +463,9 @@ public function writeTo($filename) {
case "jpeg": case "jpg": case "jpe": $type = IMAGETYPE_JPEG; break;
default: $type = IMAGETYPE_PNG; break;
}
+
+ // if $this->interlace != 0, the output image will be interlaced
+ imageinterlace ($this->gd, $this->interlace);
// if the extension does not exist, the file will not be created!
Please sign in to comment.
Something went wrong with that request. Please try again.