dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Photo gallery updating...any ideas?

  1. #1
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,930

    Photo gallery updating...any ideas?

    I've got a client with a flash photo gallery, fed from xml that he wants me to build an admin tool for.

    The xml file (and gallery) has multiple albums with multiple pics in each.

    Here's how I originally built the tool:
    Using SWF Studio and flash 9/as2
    The exe opens, load the xml file and goes to a panel that lists the categories and lets them add/remove/rename categories, they hit the next button and go to a screen that lets them add/remove images, select the category the image goes into from a drop down list and put in the image name and description.

    As the user load an image, I'm using imageMagik to take the high res image, re-size it proportionally and copy that into an 'images' directory, re-size it again (smaller) and copy that into a 'thumbs' directory.
    Works alright, until they "accept and publish" the changes. At that point, SWF Studio creates the xml file (works fine), opens an ftp connection and uploads all the images and thumbnails to the remote site...as he adds more and more images, the upload time is taking longer and longer because it uploads all the contents of the folders...

    I'd like to come up with a better way for him to "arrange" the images in the categories (I'm thinking of thumbnails in a treeview component, but that may be a bit of a nightmare), and then trying to figure out how to have the program only upload the newly updated files to the ftp site...

    Any ideas?? Any other solutions?? He uses Picasa locally to edit his files, but doesn't use PWA and I'm not sure it would be any easier to figure out how to integrate that using the API...

    hmmm....

    TIA!
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  2. #2
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    As the user load an image, I'm using imageMagik to take the high res image, re-size it proportionally and copy that into an 'images' directory, re-size it again (smaller) and copy that into a 'thumbs' directory.
    Works alright, until they "accept and publish" the changes. At that point, SWF Studio creates the xml file (works fine), opens an ftp connection and uploads all the images and thumbnails to the remote site...as he adds more and more images, the upload time is taking longer and longer because it uploads all the contents of the folders...
    If you're using JPEG images then ssCore.SysTools.resizeImage instead of imageMagik to make your life a bit easier.

    You can use ssCore.FileSys.clearAttrs to clear the archive bit on file.txt.

    When a file is modified, the archive bit gets set again by Windows.

    You can use that little bit of information, and ssCore.FileSys.getAttrs, to figure out when a file has been changed and needs to be uploaded again.

    Just remember to clear the attributes on all your files after you do an upload so you can figure out which files have been changed since the last upload.

    You might also want to tell users not to make any changes while you're uploading. Since you're going to clear all the archive bits after an upload, any changes they make to files during an upload will get missed.
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center