Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Creating thumbnail images of uploaded files

Creating thumbnail images of uploaded files
Thread Tools
Mac Enthusiast
Join Date: Jul 2003
Location: USA
Status: Offline
Reply With Quote
Mar 27, 2006, 03:42 PM
 
I'm part of a group looking to create sort of an open source website where registered users could upload files (graphics, presentations, audio files, etc.) for others to download for use in their line of work.

We also want to create preview images/thumbnails of each file (.ppt, .doc, etc.). What's the best way to do that (keeping in mind multiple users will upload files)? I suppose those who are running the site will need to create thumbnails, right? Is there a way to automate this or will it need to be done manually for each file? And, what application(s) would you recommend to achieve this?

Hope this makes sense. Thanks!
     
Mac Enthusiast
Join Date: Aug 2001
Location: Durango CO
Status: Offline
Reply With Quote
Mar 28, 2006, 09:17 PM
 
take a look at this function http://us2.php.net/manual/en/functio...yresampled.php

or also look at imagemagick
The Bitcastle
graphic design, web development, hosting
     
Professional Poster
Join Date: Jan 2001
Location: Salt Lake City, UT USA
Status: Offline
Reply With Quote
Mar 28, 2006, 10:21 PM
 
I'd recommend imagemagik as well, or netPBM
2008 iMac 3.06 Ghz, 2GB Memory, GeForce 8800, 500GB HD, SuperDrive
8gb iPhone on Tmobile
     
Mac Enthusiast
Join Date: Jul 2003
Location: USA
Status: Offline
Reply With Quote
Mar 29, 2006, 10:34 AM
 
Thanks. I was looking at ImageMagick so I appreciate the recommendations.
     
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status: Offline
Reply With Quote
Mar 31, 2006, 01:29 PM
 
This inspires me to ask a related question:

Right now, I use an AppleScript (which calls Image Events and my FTP client, Transmit) to generate thumbnails and images, sort them into the correct directories, and upload/sync them to my website in one step. It's pretty groovy. I know I could probably use ImageMagick to generate the thumbnails automatically rather than storing two copies of each image, but this approach I've created is so delightfully easy that I wonder if changing it would be worth the bother.
     
Mac Elite
Join Date: Mar 2001
Location: CO
Status: Offline
Reply With Quote
Mar 31, 2006, 02:44 PM
 
Selo:
Are you marketing your AppleScript ...or wanting to open-source it?

<-- always up for learning from the coding of someone smarter!
TOMBSTONE: "He's trashed his last preferences"
     
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status: Offline
Reply With Quote
Mar 31, 2006, 02:59 PM
 
Originally Posted by Love Calm Quiet
Selo:
Are you marketing your AppleScript ...or wanting to open-source it?

<-- always up for learning from the coding of someone smarter!
Oh, heck no. It's just a simple script and I'm glad to share it. Here it is:
Code:
on open draggedItems repeat with currentFile in draggedItems tell application "System Events" set home_directory to (path to current user folder) as string end tell -- change next two lines according to your needs set image_folder to (home_directory & "Sites:barridoff:2006:images") set thumbnail_folder to (home_directory & "Sites:barridoff:2006:thumbnails") set image_path to image_folder set thumbnail_path to thumbnail_folder try tell application "Image Events" launch set openedFile to open (currentFile as alias) set properties of openedFile to {bit depth:millions of colors, color space:RGB, resolution:{72.0, 72.0}} scale openedFile to size 750 save openedFile as JPEG in image_path with icon scale openedFile to size 125 save openedFile as JPEG in thumbnail_path with icon close openedFile end tell on error error_message display dialog error_message end try end repeat end open tell application "Transmit" set theDoc to (make new document) tell theDoc tell current session -- change next three lines to suit your needs connect to favorite with name "Barridoff" set your stuff to "~/Sites/Barridoff/2006/" set their stuff to "2006/" list local folder list remote folder synchronize direction upload files method update end tell end tell end tell
It's not that useful unless you have Transmit. I save it as droplet and it works awesomely.
     
Mac Elite
Join Date: Mar 2001
Location: CO
Status: Offline
Reply With Quote
Mar 31, 2006, 05:11 PM
 
Awesome, Selo.
That's very kind.
TOMBSTONE: "He's trashed his last preferences"
     
Mac Elite
Join Date: Mar 2001
Location: CO
Status: Offline
Reply With Quote
Mar 31, 2006, 05:14 PM
 
Selo:
PS: Thinking about your sig... Do you think we *could* get them all to gather in one place if we gave them a state? heh heh heh...
TOMBSTONE: "He's trashed his last preferences"
     
Mac Elite
Join Date: Nov 2003
Location: Rockville, MD
Status: Offline
Reply With Quote
Mar 31, 2006, 05:24 PM
 
Originally Posted by Love Calm Quiet
Selo:
PS: Thinking about your sig... Do you think we *could* get them all to gather in one place if we gave them a state? heh heh heh...
I wish Hamas no harm. I just want them to stop killing Jews for the sake of killing Jews (or for any other reason, for that matter).
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:34 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2