Re: [PHP] Creating thumbnails
Stephen [EMAIL PROTECTED] wrote: Subject: Re: [PHP] Creating thumbnails Vanessa Vega wrote: Good day to all! I would like to ask for some help with creating automatically thumbnail pictures using PHP.. What about security issues ? people can look at your source code to see the path and image name and place it in the address bar to access the image directly without loading your script. How can you prevent them? - Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
Re: [PHP] Creating thumbnails
On Tue, July 17, 2007 4:44 am, elk dolk wrote: Stephen [EMAIL PROTECTED] wrote: Subject: Re: [PHP] Creating thumbnails Vanessa Vega wrote: Good day to all! I would like to ask for some help with creating automatically thumbnail pictures using PHP.. Did you even try to Google PHP automated thumbnail Cuz there are only a few million pages about this out there... What about security issues ? people can look at your source code to see the path and image name and place it in the address bar to access the image directly without loading your script. How can you prevent them? You can't, not really... There are barriers to access you can implement to varying degrees of success, but if my browser can show the image to me, then I've got the image, and what I do with it after that point is beyond your control. Most of the barriers you can implement are crude hacks that will annoy legitimate users more than they are worth. If you want to have the hi-res image unavailable, but the thumbnail is freely available, you pretty much just put the hi-res outside the webtree and authenticate any way you like... Google for PHP authenticate user should do the trick on that. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating thumbnails
Good day to all! I would like to ask for some help with creating automatically thumbnail pictures using PHP.. thanks in advance! vanessa vega -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating thumbnails
On Tue, 17 Jul 2007, Vanessa Vega wrote: Good day to all! I would like to ask for some help with creating automatically thumbnail pictures using PHP.. thanks in advance! Well, that's a pretty vague question. The more specific you are, the better answers you'll get. That being said, I'm happy with phpThumb - http://phpthumb.sourceforge.net/ Also see http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.exif.php and http://www.catb.org/~esr/faqs/smart-questions.html - steve ... . Steve Edberg [EMAIL PROTECTED] . . Computer Consultant University of California, Davis . . (530)754-9127 . ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating thumbnails
Sorry for not being too specific...Well, to give an overview, i am uploading images on the server, i save the names of the images on my database(mysql) for retrieving them when i display it on the site.. im doing some kind of a gallery using thumbnails but i just resize the images to a smaller size using javascript.anyway..ill check out the links u provided...thanks! Stephen Edberg [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Tue, 17 Jul 2007, Vanessa Vega wrote: Good day to all! I would like to ask for some help with creating automatically thumbnail pictures using PHP.. thanks in advance! Well, that's a pretty vague question. The more specific you are, the better answers you'll get. That being said, I'm happy with phpThumb - http://phpthumb.sourceforge.net/ Also see http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.exif.php and http://www.catb.org/~esr/faqs/smart-questions.html - steve ... . Steve Edberg [EMAIL PROTECTED] . . Computer Consultant University of California, Davis . . (530)754-9127 . ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating thumbnails
Vanessa Vega wrote: Good day to all! I would like to ask for some help with creating automatically thumbnail pictures using PHP.. thanks in advance! vanessa vega Have a look at: http://www.sitepoint.com/article/php-gallery-system-minutes Stephen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating thumbnails using Image Functions, then saving to folders
Chris asked: Is there a way to use a php FTP function to FTP the file out of the buffer to a directory on the server, or some other way to write a file to a folder without making that folder 0777? What about changing the folder's permission to 0777 during the operation and then changing it back after? That's what I have to do with my virtual host. The following is a demo I wrote that you might want to review. hth's tedd --- // how to call the function ?php $ftp_path = public_html/rw/; // note the ftp path $theDir = tmp; $theFile =text.txt; FtpPerms($ftp_path, $theDir, $theFile); ? // the function ?php // create directory and change perms via FTP connection function FtpPerms($path, $theDir, $theFile) { $server='ftp.yourdomain.com'; // ftp server $connection = ftp_connect($server); // connection $user = you; $pass = yourpassword; $result = ftp_login($connection, $user, $pass); // login to ftp server if ((!$connection) || (!$result)) { echo(No connectionbr/); return false; exit(); } else { echo(Made connectionbr/); ftp_chdir($connection, $path); // go to destination dir echo(Change Permsbr/); $str=CHMOD 0755 . $theDir; // change perms for dir (note the space after 0775 ) ftp_site($connection, $str); echo($strbr/); $filename = $theDir/$theFile; $contents = This is the contents of the file.; echo(hrbr/Writing file br/br/); $file = fopen( $filename, w ); fwrite( $file, $contents); fclose( $file ); chmod($filename,0777); echo(Change Permsbr/); $str=CHMOD 0600 . $theDir; // change perms back for dir ftp_site($connection, $str); echo($strbr/); echo(Close connectionbr/); ftp_close($connection); // close connection } } ? -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating thumbnails using Image Functions, then saving to folders
See how your network guys would feel about: A directory OUTSIDE the webtree which is 777. You can put the thumbnails in there. Then, in a PHP script that you use in the IMG tags, you would double check several things before you serve up that image: Does it match a record in the database so you know it's supposed to be there? (a whitelist of known image files) Does it look like an image to functions like http://php.net/get_image_size (a modest validity check) You could also consider doing a simple GD imagefromjpeg followed by imagejpeg. It's unlikely any malicious file could survive that and do something Evil. PS You probably CAN set up FTP access and use PHP FTP to shuffle files around... But you're then putting your FTP password into your script, and your network guys shouldn't like that either... On Wed, October 18, 2006 12:40 pm, Matthews, Chris wrote: Good Morning: I am looking to create a thumbnail from an uploaded image, and then save it to a directory. I don't have any problem with the image functions, and can successfully create the thumbnail and push it to the browser or, as is currently set up, store the data in a database. What I want to do instead, however, is take that dynamically created thumbnail and write it to a folder on the server. If I simply write the file, however, it appears I need to have a folder chmod'd world read/writable for the process to work. My network guys do not want this. I tried the FTP functions, which work great for copying a file that already exists somewhere into another folder, but I can't seem to get it to recognize the buffer as a valid source file location... Is there a way to use a php FTP function to FTP the file out of the buffer to a directory on the server, or some other way to write a file to a folder without making that folder 0777? Chris Matthews eGovernment Information Officer Washoe County, Nevada 775.328.3719 http://www.washoecounty.us Director, West Region National Association of Government Webmasters http://www.nagw.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating thumbnails using Image Functions, then saving to folders
Good Morning: I am looking to create a thumbnail from an uploaded image, and then save it to a directory. I don't have any problem with the image functions, and can successfully create the thumbnail and push it to the browser or, as is currently set up, store the data in a database. What I want to do instead, however, is take that dynamically created thumbnail and write it to a folder on the server. If I simply write the file, however, it appears I need to have a folder chmod'd world read/writable for the process to work. My network guys do not want this. I tried the FTP functions, which work great for copying a file that already exists somewhere into another folder, but I can't seem to get it to recognize the buffer as a valid source file location... Is there a way to use a php FTP function to FTP the file out of the buffer to a directory on the server, or some other way to write a file to a folder without making that folder 0777? Chris Matthews eGovernment Information Officer Washoe County, Nevada 775.328.3719 http://www.washoecounty.us Director, West Region National Association of Government Webmasters http://www.nagw.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating thumbnails using Image Functions, then saving to folders
On 10/18/06, Matthews, Chris [EMAIL PROTECTED] wrote: Good Morning: I am looking to create a thumbnail from an uploaded image, and then save it to a directory. I don't have any problem with the image functions, and can successfully create the thumbnail and push it to the browser or, as is currently set up, store the data in a database. What I want to do instead, however, is take that dynamically created thumbnail and write it to a folder on the server. If I simply write the file, however, it appears I need to have a folder chmod'd world read/writable for the process to work. My network guys do not want this. I tried the FTP functions, which work great for copying a file that already exists somewhere into another folder, but I can't seem to get it to recognize the buffer as a valid source file location... Is there a way to use a php FTP function to FTP the file out of the buffer to a directory on the server, or some other way to write a file to a folder without making that folder 0777? Chris Matthews eGovernment Information Officer Washoe County, Nevada 775.328.3719 http://www.washoecounty.us Director, West Region National Association of Government Webmasters http://www.nagw.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If the server is apache make the directory you are writing images out to owned by apache and you'll be all set. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating thumbnails using Image Functions, then saving to folders
On Wednesday 18 October 2006 19:40, Matthews, Chris wrote: Good Morning: I am looking to create a thumbnail from an uploaded image, and then save it to a directory. I don't have any problem with the image functions, and can successfully create the thumbnail and push it to the browser or, as is currently set up, store the data in a database. What I want to do instead, however, is take that dynamically created thumbnail and write it to a folder on the server. If I simply write the file, however, it appears I need to have a folder chmod'd world read/writable for the process to work. My network guys do not want this. open a folder that is writable by the webserver e.g. apache. only way the images ever automaticly will be available for the users of the pages. No writeaccess no nothing. I tried the FTP functions, which work great for copying a file that already exists somewhere into another folder, but I can't seem to get it to recognize the buffer as a valid source file location... Is there a way to use a php FTP function to FTP the file out of the buffer to a directory on the server, or some other way to write a file to a folder without making that folder 0777? Chris Matthews eGovernment Information Officer Washoe County, Nevada 775.328.3719 http://www.washoecounty.us Director, West Region National Association of Government Webmasters http://www.nagw.org -- --- Børge Kennel Arivene http://www.arivene.net --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] creating thumbnails
hello I have a form from where you can upload an image. the script saves the file on the server in a folder. what I want now is when it saves the file; I also want to save a copy of that file in another folder with thumbnail size. How do I create a copy with for example 100 x 100 and save that? thanks max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] creating thumbnails
[snip] I have a form from where you can upload an image. the script saves the file on the server in a folder. what I want now is when it saves the file; I also want to save a copy of that file in another folder with thumbnail size. How do I create a copy with for example 100 x 100 and save that? [/snip] Start with TFM at http://us2.php.net/image -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] creating thumbnails
On Fri, 2004-03-12 at 15:17, Maxi Yedid wrote: [snip] what I want now is when it saves the file; I also want to save a copy of that file in another folder with thumbnail size. How do I create a copy with for example 100 x 100 and save that? If you are using Linux (maybe others too) you might be able to use 'mogrify' which is part of ImageMagick. I think it works very well for this. http://www.imagemagick.org/www/mogrify.html - Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] creating thumbnails from .BMP files
Hey, How do you create thumbnails from .BMP files? Is there a function like there is for JPG (ImageJPEG)? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] creating thumbnails from .BMP files
How do you create thumbnails from .BMP files? Is there a function like there is for JPG (ImageJPEG)? Probably need to use an external program that understands that format and an exec() call. ---John W. Holmes... Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] creating thumbnails from .BMP files
image_bmp class at www.phpclasses.org can create bmp files, you might be able to write a class that will read it and return raw data. Artoo Smith wrote: Hey, How do you create thumbnails from .BMP files? Is there a function like there is for JPG (ImageJPEG)? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating thumbnails
Hello everybody, I just finished reading a message from the server root and I have been told that the server I have to work with by our current project doesn't support GD and they can't install it neither. We will, however, need to create thumbnails from larger images (JPEG). Are there any other solutions that don't require installing? Some CGI scripts or something similar perhaps? Or does anybody have any other ideas? Perhaps letting another server to do the thumbnailing? There will be only a max of 20 images per day which have to be converted to a 100*200px image. Our main scripting language will be PHP and the database will be some form of SQL. Thanks in advance! Yours, Lauri -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Creating thumbnails
Hi Lauri, @ 11:55:51 AM on 4/15/2001, Lauri Vain wrote: ... I just finished reading a message from the server root and I have been told that the server I have to work with by our current project doesn't support GD and they can't install it neither. We will, however, need to create thumbnails from larger images (JPEG). Are there any other solutions that don't require installing? Some CGI scripts or something similar perhaps? ... Our main scripting language will be PHP and the database will be some form of SQL. Ask your sysadmin if the server has ImageMagick or NetPBM installed. You can use either of those to create thumbnails using system(). -Brian -- PGP is spoken here: 0xE4D0C7C8 Please, DO NOT carbon copy me on list replies. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]