- Saved searches
- Use saved searches to filter your results more quickly
- License
- JamesHeinrich/phpThumb
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- Saved searches
- Use saved searches to filter your results more quickly
- masterexploder/PHPThumb
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- Saved searches
- Use saved searches to filter your results more quickly
- License
- jamiebicknell/Thumb
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
phpThumb() — The PHP thumbnail generator
License
JamesHeinrich/phpThumb
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
phpThumb() — The PHP thumbnail generator
phpThumb() uses the GD library and/or ImageMagick to create thumbnails from images (GIF, PNG or JPEG) on the fly. The output size is configurable (can be larger or smaller than the source), and the source may be the entire image or only a portion of the original image. True color and resampling is used if GD v2.0+ is available, otherwise low-color and simple resizing is used. Source image can be a physical file on the server or can be retrieved from a database. GIFs are supported on all versions of GD even if GD does not have native GIF support thanks to the GIFutil class by Fabien Ezber. AntiHotlinking feature prevents other people from using your server to resize their thumbnails, or link to your images from another server. The cache feature reduces server load.
About
phpThumb() — The PHP thumbnail generator
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
PHP Thumbnail & Image Manipulation Library
masterexploder/PHPThumb
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Version 7.2 throws an warning when setOptions method is called Warning: sizeof(): Parameter must be an array or an object that implements Countable in /path/to/project/vendor/masterexploder/phpthumb/src/PHPThumb/GD.php on line
Git stats
Files
Failed to load latest commit information.
README.md
This project was recently updated to 2.0 and is PSR-0 compliant and supports Composer integration. Some parts of the documentation are incorrect as they haven’t been updated for the new version. Your 1.0 code is not compatible with 2.0! Please review the updated examples for how to use the new version.
PHP Thumb is a light-weight image manipulation library aimed at thumbnail generation. It features the ability to resize by width, height, and percentage, create custom crops, or square crops from the center, and rotate the image. You can also easily add custom functionality to the library through plugins. It also features the ability to perform multiple manipulations per instance (also known as chaining), without the need to save and re-initialize the class with every manipulation.
More information and documentation is available at the project’s wiki: https://github.com/masterexploder/PHPThumb/wiki
I’ve tried to thoroughly document things as best I can, but here’s a list of places to find documentation / help:
- Documentation — Your best friend, the library docs
- Forums — Got questions, comments, or feedback? This is the place to visit
- Developer Docs — Auto-generated docs for developers… these cover the code itself
PHP Thumb is released under MIT license.
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
A simple, local image only, thumbnail generation script written in PHP
License
jamiebicknell/Thumb
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
A simple, local image only, thumbnail generation script written in PHP with a file based cache and optional browser based cache.
Firstly, make sure your cache directory is writable, then access the script like so:
img src='thumb.php?src=./images/photo.jpg&size=400x300' />
Key | Example Value | Default | Description |
---|---|---|---|
src | ./images/photo.jpg | Absolute path, relative path, or local URL to the source image. Remote URLs are not allowed | |
size | 100, 100×200, 100x, x100, | 100 | Width and/or height must be between 8 and 1500 |
crop | 0 — 1 | 1 | 0 = Displays the entire image within the canvas 1 = Crop the image so that the entire canvas is used |
trim | 0 — 1 | 0 | 0 = Displays white space for unused canvas 1 = Removes any white space |
zoom | 0 — 1 | 0 | For when the size of the canvas is larger than the original image size 0 = Will not enlarge image 1 = Enlarges image beyond the original image size |
align | c, t, r, b, l, tl, tr, br, bl | c | Alignment of image when cropped |
sharpen | 0 — 100 | 0 | Percentage strength of the image sharpness, based on the percentage midpoint of 12 (strong) and 28 (weak) |
gray | 0 — 1 | 0 | 0 = Displays resized image as normal 1 = Converts image to grayscale |
ignore | 0 — 1 | 0 | 0 = Displays resized image as normal 1 = Displays original image file with the animation present |
Value | Description |
---|---|
250 | Creates a square image 250px in width and 250px in height |
250×400 | Creates an image 250px in width and 400px in height |
250x | Creates an image with a width of 250px and the height will be automatically calculated to maintain the aspect ration of the original image |
x250 | Createse an image with a height of 250px and the width will be automatically calculated to maintain the aspect ration of the original image |
Creates an image where the width or height does not exceed 800px. For landscape images the width will be 800px and the height will be automatically calculated, and for portrait images the height will be 800px and the width will be automatically calculated. |
Automatic Orientation Correction
If you’re dealing with images straight from a camera, some may contain EXIF data which specifies the original orientation the image should be viewed at.
To enable this feature, change the constant ADJUST_ORIENTATION to true .
More information, and an in depth analysis of EXIF Orientation can be found in this article written by @daveperrett
Thumb.php is licensed under the MIT license, see LICENSE.md for details.
About
A simple, local image only, thumbnail generation script written in PHP