1 //////////////////////////////////////////////////////////////
2 /// phpThumb() by James Heinrich <info@silisoftware.com> //
3 // available at http://phpthumb.sourceforge.net ///
4 //////////////////////////////////////////////////////////////
6 // Frequently Asked Questions (FAQ) about phpThumb() //
8 //////////////////////////////////////////////////////////////
11 Q: What is the GPL? Can I use this for commercial sites?
12 A: See the GPL FAQ: http://www.gnu.org/licenses/gpl-faq.html
13 In general, if you just want to call phpThumb.php in the
14 standard <img src="phpThumb.php?src=pic.jpg&w=100"> manner
15 then there is no problem, you're free to do this no matter
16 if you site is commercial or not, or what license your code
18 If you're calling phpThumb() as an object then you will
19 probably run into license issues, so consult the above FAQ
21 No matter if you use phpThumb() commercially or not, no
22 payment is required. However, donations are always welcome
23 and can be made at http://phpthumb.sourceforge.net
26 Q: Some images generate thumbnails, but some fail (the original
27 non-resized image is output instead).
28 A: Your PHP installation does not have a high enough memory_limit
29 and ImageMagick is not installed on the server. The PHP memory
30 required is 5 times the number of pixels in the image.
34 You can adjust the PHP memory limit in php.ini (if you have
35 permission on your server to do so), or (better yet) install
36 ImageMagick on the server and that will bypass the memory limit
37 issue. If you can't do either of the above, you can resize the
38 images manually (with your favourite image editor) to a size
39 that your memory_limit setting can handle, and/or you can
40 re-save the images with an image editor that can embed an EXIF
41 thumbnail (Photoshop for example) which phpThumb can use as an
42 image source (lower image quality, but perhaps better than
46 Q: I'm getting is this error message:
47 Failed: RenderToFile(<filename>) failed because
48 !is_resource($this->gdimg_output)
49 A: You missed the call to GenerateThumbnail() before
50 RenderToFile() or OutputThumbnail.
51 See /demo/phpThumb.demo.object.php for an example.
54 Q: I'm trying to save a phpThumb-generated image in Internet
55 Explorer and it saves in BMP format, why?
56 A: This is not phpThumb's fault, it is an IE issue:
57 http://support.microsoft.com/default.aspx?scid=kb;en-us;810978
58 http://support.microsoft.com/default.aspx?scid=kb;en-us;260650
61 Q: PNG images with transparent areas show up with gray background
62 in the areas that are supposed to be transparent.
63 A: Internet Explorer has had a broken PNG alpha-channel display
64 implementation for a decade, so it may never get fixed. Other
65 major browsers generally handle alpha-transparent PNGs fine.
66 See http://www.silisoftware.com/png_transparency/
67 For an alpha-channel PNG display in IE hack, see this page:
68 http://www.koivi.com/ie-png-transparency/
71 Q: I'm getting "<filename> does not exist" when I know the
73 A: Check these two values are present and properly configured
74 in phpThumb.config.php (introduced in v1.6.0):
75 $PHPTHUMB_CONFIG['allow_src_above_docroot'] (default=false)
76 $PHPTHUMB_CONFIG['allow_src_above_phpthumb'] (default=true)
77 If your images are outside DOCUMENT_ROOT then you will have
78 to configure 'allow_src_above_docroot' to true
81 Q: Are there any front-end GUI interfaces to phpThumb()?
82 A: See /demo/readme.demo.txt
85 Q: Why can't Flash work with images output from phpThumb()?
86 A: Flash doesn't like progressive JPEG. Set:
87 $PHPTHUMB_CONFIG['output_interlace'] = false;
90 Q: Image quality is not very good - why?
91 A: If you're using GD v1.x, no way around it. Upgrade to GD v2.x
94 Q: Image quality is very bad, very pixelated - why?
95 A: You may be trying to resize images larger than the available
96 PHP memory, so phpThumb is simply extracting and using the
97 EXIF thumbnail as the image source, which is usually about
98 160x120 (so if you resize it to 640x480 it will look very bad).
99 To calculate the required size for memory_limit in php.ini,
100 calculate the number of pixels in the image and multiply by 5:
101 For example, 1600x1200 = 1600 * 1200 * 5 = 9600000 = 10M