> Forums > Active Social > General Discussion > Amazon S3 & Server - duplicate images
Last Post 05 Dec 2011 03:26 PM by Andrew Walker. 4 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Andrew Walker
Customers
Andrew Walker
Post Count:42

--
02 Dec 2011 12:07 PM
    Been running AS 1.9.3 - just upgraded to 1.9.4 so I don't know if this is fixed.

    I am noticing my site is now over 3GB - and even though S3 for galleries is ON - I am having images on both sides.   I see that the gallery is displaying the images from Amazon S3 (for a specific group) but not sure why it didn't clear out the images on the server.

    Also - the images on the local server are not resized at all.  All images in lg, md, & sm are the Same image & same size.  On Amazon S3 - they are resized as they should be.

    Any tips/suggestions for cleaning this up? IE: knowing which LOCAL images I can nuke because they correctly exist on S3?  And was this the gallery fix in 1.9.4?  Or should I be logging this as a ticket?

    Thanks for any input!!!
    Our Sites that use ActiveSocial:
    BigGameLogic.com - for the serious deer hunter (track deer movement/patterns).
    ForemostBrewing.com - for the homebrewer and winemaker
    ForemostHunting.com - for the avid hunting sportsman
    GameBirdHunts.com - for the upland game bird hunter
    Andrew Walker
    Customers
    Andrew Walker
    Post Count:42

    --
    02 Dec 2011 02:09 PM
    Upon further investigation - I'm noticing the images on Amazon S3 are all .PNG while the majority of the images locally are .JPG.   I understand it's because I have image format set to PNG's in ActiveSocial - but just curious why the original isn't deleted?

    If the image isn't listed in the activesocial_Files table - I'm assuming I can delete it.... so that's what I just did and released 2.8 GB of space!

    What I did is write a small program to do the following.

    FIRST I BACKED UP MY portals/0/activesocial folder  (THIS IS IMPORTANT!!!)

    localImages = Get all images from activesocial_Files where the FilePath starts w/ "~" (no quotes)
    s3Images = Get all iaimges from activesocial_Files where FilePath starts w/ "http://" (no quotes) 

    Looping s3Images do the followign:
    [LOOP]
         tempFilePath = s3Image filepath changed to local version (IE: change "http://bucket.amazonsaws.com" with "~/Portals")

         tempFileImage = s3Image Filename.Replace(".png", ".jpg) (as my imgs are converted to PNG on S3)

         make sure localImages doesn't contain an img w/ Filename = tempFileImage (if it does - the image is supopse to be local and not deleted)

         [LOOP for sm, md, and lg folders]
              check if file exists locally, if so, delete it
         [/LOOP for sm, md, lg]
    [/LOOP]

    NOTE: I did NOT modify anything in the DB - I only deleted Local files that seem to have no reference from the activesocial_Files table... as it seems to me that nothing is using them.

    Everything seems to be OK - but I've got way too many groups to physically check them.  The files seem aligned w/ the db table.

    If I just went nuts and did something stupid - please let me know ASAP! 
    Our Sites that use ActiveSocial:
    BigGameLogic.com - for the serious deer hunter (track deer movement/patterns).
    ForemostBrewing.com - for the homebrewer and winemaker
    ForemostHunting.com - for the avid hunting sportsman
    GameBirdHunts.com - for the upland game bird hunter
    Andrew Walker
    Customers
    Andrew Walker
    Post Count:42

    --
    02 Dec 2011 02:15 PM
    Posted By Jon Ballard on 02 Dec 2011 03:09 PM
    Looping s3Images do the followign:
    [LOOP]
         tempFilePath = s3Image filepath changed to local version (IE: change "http://bucket.amazonsaws.com" with "~/Portals")

         tempFileImage = s3Image Filename.Replace(".png", ".jpg) (as my imgs are converted to PNG on S3)

         make sure localImages doesn't contain an img w/ Filename = tempFileImage (if it does - the image is supopse to be local and not deleted)

         [LOOP for sm, md, and lg folders]
              check if file exists locally, if so, delete it
         [/LOOP for sm, md, lg]
    [/LOOP]


    Clarification on the bolded step - above.  Be sure to check for both Filename = tempFileImage AND Filepath = tempFilePath as were looking for specific images.  Not just random images named for instance : img006.jpg as that could exist in multiple galleries.
    Our Sites that use ActiveSocial:
    BigGameLogic.com - for the serious deer hunter (track deer movement/patterns).
    ForemostBrewing.com - for the homebrewer and winemaker
    ForemostHunting.com - for the avid hunting sportsman
    GameBirdHunts.com - for the upland game bird hunter
    Frozen DNN
    Customers
    Frozen DNN
    Post Count:1331

    --
    02 Dec 2011 04:02 PM
    If I remember it correctly, AS gallery does not transfer large images to S3. I was told that there is a limitation in AS or S3 code. I don't know whether this has been fixed now.
    I am using the latest AS/AF/DNN available.
    Thanks.
    Andrew Walker
    Customers
    Andrew Walker
    Post Count:42

    --
    05 Dec 2011 03:26 PM
    This wasn't an issue for me as the images all did get transferred to Amazon S3 - they just weren't being deleted then locally.
    Our Sites that use ActiveSocial:
    BigGameLogic.com - for the serious deer hunter (track deer movement/patterns).
    ForemostBrewing.com - for the homebrewer and winemaker
    ForemostHunting.com - for the avid hunting sportsman
    GameBirdHunts.com - for the upland game bird hunter
    You are not authorized to post a reply.
    > Forums > Active Social > General Discussion > Amazon S3 & Server - duplicate images
    test
    Copyright 2012 by DotNetNuke Corporation / Terms of Use / Privacy