mirror of
https://github.com/Geckon01/simple-image-compressor.git
synced 2026-07-11 23:12:04 +00:00
Small code style improvements
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "geckon01/simple-image-compressor",
|
"name": "geckon01/simple-image-compressor",
|
||||||
"description": "SimpleImageCompressor is a tiny simple PHP image compressor lib which allows you to compress any image easily on the fly",
|
"description": "SimpleImageCompressor is a tiny simple PHP image compressor lib which allows you to compress any image easily on the fly",
|
||||||
"version": "0.3.10",
|
"version": "0.3.10.17",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"php",
|
"php",
|
||||||
"images",
|
"images",
|
||||||
|
|||||||
@@ -87,8 +87,7 @@ class SimpleImageCompressor
|
|||||||
private function loadImageType() {
|
private function loadImageType() {
|
||||||
$this->imageType = "image";
|
$this->imageType = "image";
|
||||||
|
|
||||||
if($this->exifLoaded)
|
if($this->exifLoaded) {
|
||||||
{
|
|
||||||
switch (exif_imagetype($this->imageResourceUrl))
|
switch (exif_imagetype($this->imageResourceUrl))
|
||||||
{
|
{
|
||||||
case IMAGETYPE_GIF:
|
case IMAGETYPE_GIF:
|
||||||
@@ -120,9 +119,11 @@ class SimpleImageCompressor
|
|||||||
|
|
||||||
if (substr($this->imageData, 0, 2) === "\xFF\xD8") {
|
if (substr($this->imageData, 0, 2) === "\xFF\xD8") {
|
||||||
$this->imageType = 'image/jpeg';
|
$this->imageType = 'image/jpeg';
|
||||||
} else if (substr($this->imageData, 0, 3) === "\x89\x50\x4E") {
|
}
|
||||||
|
if (substr($this->imageData, 0, 3) === "\x89\x50\x4E") {
|
||||||
$this->imageType = 'image/png';
|
$this->imageType = 'image/png';
|
||||||
} else if (substr($this->imageData, 0, 4) === "\x47\x49\x46\x38") {
|
}
|
||||||
|
if (substr($this->imageData, 0, 4) === "\x47\x49\x46\x38") {
|
||||||
$this->imageType = 'image/gif';
|
$this->imageType = 'image/gif';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user