class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
here is my png before "transforming": http://koko.securityhost.pl/upload/yt.png here is after "transforming": http://koko.securityhost.pl/upload/gotowe/2012/05/4fb29c6f6526e.txt
so u can see that new image haven't watermark and many images from GIMP have this problem.
I also agree that it is not good to be loading PHP for every style sheet. If you load one PHP page with two dynmiac' style sheets, that's 3 PHP calls for every loaded page, for every visitor. That will add up real quick if/when your website starts to pull traffic.The best thing to do is leave the stylesheets static. If you need to add dynmiac style information, include it in the actual web page in style tags.cigraphics is on the right track for re-generating static style sheets when changes are made to the website, but then you have to worry about browsers caching their CSS sheets because they are expected to be static. I know there are workarounds for that, but why worry about it? Just include any dynmiac content in the main web page.Reply
with $foo->allowed = array('image/jpeg','image/jpg','image/gif','image/png','image/bmp');
system information - class version : 0.31 - operating system : Linux - PHP version : 5.2.17 - GD version : 2.0.34 - supported image types : png jpg gif bmp - open_basedir : no restriction - upload_max_filesize : 64M (67108864 bytes) - language : en_GB source is a local file /home/tmp/phpGWFVUT - local file name OK determining MIME type - Checking MIME type with Fileinfo PECL extension Fileinfo PECL extension not available - Checking MIME type with UNIX file() command PHP exec() function is disabled - Checking MIME type with mime.magic file (mime_content_type()) MIME type detected as text/plain by mime_content_type() - MIME validated as text/plain source variables - You can use all these before calling process() file_src_name : phpGWFVUT file_src_name_body : phpGWFVUT file_src_name_ext : file_src_pathname : /home/tmp/phpGWFVUT file_src_mime : text/plain file_src_size : 37833 (max= 67108864) file_src_error : 0 process file to ./upload/gotowe/2012/05/ - file size OK - file renamed as phpGWFVUT.txt! - error: Incorrect type of file.
and without: system information - class version : 0.31 - operating system : Linux - PHP version : 5.2.17 - GD version : 2.0.34 - supported image types : png jpg gif bmp - open_basedir : no restriction - upload_max_filesize : 64M (67108864 bytes) - language : en_GB source is a local file /home/tmp/php8TsHdL - local file name OK determining MIME type - Checking MIME type with Fileinfo PECL extension Fileinfo PECL extension not available - Checking MIME type with UNIX file() command PHP exec() function is disabled - Checking MIME type with mime.magic file (mime_content_type()) MIME type detected as text/plain by mime_content_type() - MIME validated as text/plain source variables - You can use all these before calling process() file_src_name : php8TsHdL file_src_name_body : php8TsHdL file_src_name_ext : file_src_pathname : /home/tmp/php8TsHdL file_src_mime : text/plain file_src_size : 37833 (max= 67108864) file_src_error : 0 process file to ./upload/gotowe/2012/05/ - file size OK - file renamed as php8TsHdL.txt! - file mime OK : text/plain - new file name body : 4fb2c7d655b72 - file name safe format - destination variables file_dst_path : ./upload/gotowe/2012/05/ file_dst_name_body : 4fb2c7d655b72 file_dst_name_ext : txt - checking for auto_rename - destination file details file_dst_name : 4fb2c7d655b72.txt file_dst_pathname : ./upload/gotowe/2012/05/4fb2c7d655b72.txt - 4fb2c7d655b72.txt doesn't exist already - no image processing wanted - process OKReply
You PHP instance is wrongly configured, the MIME types detection is incorrect. The function mime_content_type() bases its detection on the mime.magic file, you may want to check that. Note that this is now deprecated in favor of PECL FileInfo, which your sstem doesn't seem to have.Reply
here is my png before "transforming":
http://koko.securityhost.pl/upload/yt.png
here is after "transforming":
http://koko.securityhost.pl/upload/gotowe/2012/05/4fb29c6f6526e.txt
so u can see that new image haven't watermark and many images from GIMP have this problem.
When i was adding this:
nothing happen becouse script thinking that my png is txt
any solution for me?
system information
- class version : 0.31
- operating system : Linux
- PHP version : 5.2.17
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 64M (67108864 bytes)
- language : en_GB
source is a local file /home/tmp/phpGWFVUT
- local file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
Fileinfo PECL extension not available
- Checking MIME type with UNIX file() command
PHP exec() function is disabled
- Checking MIME type with mime.magic file (mime_content_type())
MIME type detected as text/plain by mime_content_type()
- MIME validated as text/plain
source variables
- You can use all these before calling process()
file_src_name : phpGWFVUT
file_src_name_body : phpGWFVUT
file_src_name_ext :
file_src_pathname : /home/tmp/phpGWFVUT
file_src_mime : text/plain
file_src_size : 37833 (max= 67108864)
file_src_error : 0
process file to ./upload/gotowe/2012/05/
- file size OK
- file renamed as phpGWFVUT.txt!
- error: Incorrect type of file.
and without:
system information
- class version : 0.31
- operating system : Linux
- PHP version : 5.2.17
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 64M (67108864 bytes)
- language : en_GB
source is a local file /home/tmp/php8TsHdL
- local file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
Fileinfo PECL extension not available
- Checking MIME type with UNIX file() command
PHP exec() function is disabled
- Checking MIME type with mime.magic file (mime_content_type())
MIME type detected as text/plain by mime_content_type()
- MIME validated as text/plain
source variables
- You can use all these before calling process()
file_src_name : php8TsHdL
file_src_name_body : php8TsHdL
file_src_name_ext :
file_src_pathname : /home/tmp/php8TsHdL
file_src_mime : text/plain
file_src_size : 37833 (max= 67108864)
file_src_error : 0
process file to ./upload/gotowe/2012/05/
- file size OK
- file renamed as php8TsHdL.txt!
- file mime OK : text/plain
- new file name body : 4fb2c7d655b72
- file name safe format
- destination variables
file_dst_path : ./upload/gotowe/2012/05/
file_dst_name_body : 4fb2c7d655b72
file_dst_name_ext : txt
- checking for auto_rename
- destination file details
file_dst_name : 4fb2c7d655b72.txt
file_dst_pathname : ./upload/gotowe/2012/05/4fb2c7d655b72.txt
- 4fb2c7d655b72.txt doesn't exist already
- no image processing wanted
- process OK