7 Replies Latest reply on May 8, 2007 5:45 AM by peterent

    Image Resizing

    jfillman Level 1
      I am trying to make an application for a family site that will allow my family to upload pictures from their PC (planning an Apollo app for family) and create albums. The issue I have is that these images are 3-4+ megabytes each, which are slow to upload and slow to view. For web viewing, there is no need for images that size. I need a way to re-size/down-size the photos while uploading them to the website. I also don't want to be paying for storing these huge photos, when smaller versions still look great online.

      Any help would be greatly appreciated.
        • 1. Re: Image Resizing
          jfillman Level 1
          • 2. Re: Image Resizing
            peterent Level 2
            So you want to send out an Apollo app which would read an image and rescale it, then upload the rescaled image to a web site?

            I know that a) Apollo can read local files, b) you can get the bytes from the image as a Bitmap (not quite sure how, exactly, but it should be possible) and c) you can upload files using the FileReference classes.

            What I don't know is how to resample the bytes to scale it down. This sounds like a great idea for an Apollo component (you could charge $$ for it and post it to the Adobe exchange) if you can pull it off.

            Sorry I wasn't that helpful.
            • 3. Re: Image Resizing
              upshotvideo Level 1
              If you want the photos to resize during upload, then that would be handled by the script you use to handle the upload(PHP, etc). Flex does'nt do the actual handling and moving of the file, a server side script does, that is where you tackle this issue.
              • 4. Re: Image Resizing
                jfillman Level 1
                Flex passes the actual image or images as an array to PHP, so Flex should have access to perform actions on the image(s) before passing to PHP.
                • 5. Re: Image Resizing
                  upshotvideo Level 1
                  But I wouldnt think that you would want the users original image to altered, it should be uploaded, resized, and then moved to the appropriate directory
                  • 6. Re: Image Resizing
                    jfillman Level 1
                    That's a good point. I'm not familiar enough with this to know if modifications would be made to the original, or if Flex cache's a copy that I can deal with. II suppose I could also create a temp file to manipulate, upload, then delete.
                    • 7. Re: Image Resizing
                      peterent Level 2
                      The problem is that the images are large and therefore take time to upload so ideally you want to resize them first to reduce the transit time. I'm pretty sure you can do this with Flex/Apollo. I haven't had any experience with it, but it is well worth investigating.