-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit
- Loading branch information
Showing
26 changed files
with
2,712 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Eclipse files # | ||
################# | ||
.project | ||
.buildpath | ||
.settings | ||
.jsdtscope | ||
org.eclipse.* | ||
|
||
# PHPStorm files # | ||
################# | ||
.idea/* | ||
|
||
# Composer files # | ||
################# | ||
composer.lock | ||
composer.phar | ||
vendor | ||
vendor/* | ||
|
||
# Compiled source # | ||
################### | ||
*.com | ||
*.class | ||
*.dll | ||
*.exe | ||
*.o | ||
*.so | ||
|
||
# Packages # | ||
############ | ||
# it's better to unpack these files and commit the raw source | ||
# git has its own built in compression methods | ||
*.7z | ||
*.dmg | ||
*.gz | ||
*.iso | ||
*.jar | ||
*.rar | ||
*.tar | ||
*.zip | ||
|
||
# Logs and databases # | ||
###################### | ||
*.log | ||
*.sql | ||
*.sqlite | ||
|
||
# OS generated files # | ||
###################### | ||
.DS_Store? | ||
ehthumbs.db | ||
Icon? | ||
Thumbs.db | ||
/testData | ||
|
||
|
||
# Test generated files # | ||
##################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Resize animated Gif files | ||
|
||
|
||
This package aims to implement a proper resizing of gif files encompassing the GIF89a specification. | ||
|
||
|
||
## Introduction | ||
|
||
Most, if not all other publicly available gif resize packages fails with optimized gif files, | ||
those where only parts of the file are updated in subsequent frames. See these are a background image, | ||
with sprites moving about. | ||
The resulting gif will retain its aspect ratio. | ||
|
||
The package is a bit pedantic in its approach. It was made as much for me to learn what Gifs were | ||
and how they work, as it was to solve specific problem. | ||
|
||
## Usage | ||
|
||
The package needs to write to a file, the reasons for not just return a string is twofold. | ||
One being memory usage, the other is that you really don't want to be dynamically resizing | ||
often used gif files every time they are used. | ||
|
||
### Initialization | ||
|
||
```php | ||
include "../vendor/autoload.php"; | ||
use grandt\ResizeGif\ResizeGif; | ||
|
||
$srcFile = "[path to original gif file]"; | ||
$dstFile = "[path to resized file]"; | ||
|
||
ResizeGif::ResizeToWidth($srcFile, $dstFile, 100); | ||
``` | ||
|
||
### To make a 100 pixel wide thumbnail | ||
|
||
```php | ||
ResizeGif::ResizeToWidth($srcFile, $dstFile, 100); | ||
``` | ||
|
||
### To make a 100 pixel high thumbnail | ||
|
||
```php | ||
ResizeGif::ResizeToHeight($srcFile, $dstFile, 100); | ||
``` | ||
|
||
### To double the size of the gif. | ||
|
||
```php | ||
ResizeGif::ResizeByRatio($srcFile, $dstFile, 2.0); | ||
``` | ||
|
||
### To half the size of the gif. | ||
|
||
```php | ||
ResizeGif::ResizeByRatio($srcFile, $dstFile, 0.5); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--------------------------------------------------------------------- | ||
Rev. 1.0.0 - 2015-04-27 | ||
Initial release | ||
--------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "grandt/phpresizegif", | ||
"type": "library", | ||
"description": "GIF89a compliant Gif resizer, including transparency and optimized gifs with sub sized elements.", | ||
"keywords": ["gif", "animated gif", "resize", "GIF89a"], | ||
"homepage": "https://github.com/Grandt/PHPResizeGif", | ||
"minimum-stability": "stable", | ||
"license": "LGPL-2.1", | ||
"version": "1.0.0", | ||
"authors": [ | ||
{ | ||
"name": "A. Grandt", | ||
"email": "[email protected]", | ||
"homepage": "http://grandt.com", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"grandt/binstring": "0.2.0.x-dev", | ||
"php": ">=5.3.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"grandt\\ResizeGif\\": "src/ResizeGif", | ||
"grandt\\ResizeGif\\Files\\": "src/ResizeGif/Files", | ||
"grandt\\ResizeGif\\Structure\\": "src/ResizeGif/Structure", | ||
"grandt\\ResizeGif\\Debug\\": "src/ResizeGif/Debug" | ||
} | ||
} | ||
} |
Oops, something went wrong.