Bulk Zoom Thumbnails to Ratio script available for Firefox

mattwrightmattwright Registered Users Posts: 124 Major grins
I desire most of my galleries to have thumbnails with a 1:1 ratio, but did not want to go through and manually zoom each thumbnail. I wrote a Greasemonkey script that will zoom the thumbnails for all photos in a gallery to the specified ratio (or back to their original ratio).

You can find it at http://www.scriptarchive.com/gm_smugmug.html

I have tested it on several of my galleries, but it is still very new, so if you have any problems with it, please let me know.

Matt
«1

Comments

  • RockportersRockporters Registered Users Posts: 225 Major grins
    edited September 17, 2007
    thumb.gif Works great! Tried it out using the Mac version of Firefox (1.0.0.6).

    I know it's a problem with multiple pages, but I wish these types of utilities could work with the smugmug layout, it would eliminate all the switching settings back and forth.
    Beth

    Nikon D300
    Nikon 70-200mm f/2.8
    Nikon 18-200mm f/3.5-5.6
    Nikon 50mm f/1.8D


    [SIZE=-3]Mary Beth Glasmann Photography[/SIZE]
  • saurorasaurora Registered Users Posts: 4,320 Major grins
    edited September 17, 2007
    Hi Matt! Thanks for doing this .... I used it on one gallery this morning and it worked great! clap.gif
  • mattwrightmattwright Registered Users Posts: 124 Major grins
    edited September 17, 2007
    Re: smugmug layout
    I know it's a problem with multiple pages, but I wish these types of utilities could work with the smugmug layout, it would eliminate all the switching settings back and forth.
    FYI, the reason I disabled it for the smugmug layout is that the list of images embedded in the JavaScript source for that page contains images that aren't actually viewable, so it wouldn't be obvious which images you were zooming necessarily.
  • NimaiNimai Registered Users Posts: 564 Major grins
    edited September 18, 2007
    Haha- I guess I [thread=64198]posted mine[/thread] in the wrong section! Coulda saved you some tinkering, although that's the fun part!
  • mattwrightmattwright Registered Users Posts: 124 Major grins
    edited September 18, 2007
    Re: additional code
    Nimai wrote:
    Haha- I guess I [thread=64198]posted mine[/thread] in the wrong section! Coulda saved you some tinkering, although that's the fun part!
    Nice! Correct me if I'm wrong, but it appears that your code still requires one to navigate to each individual image page? The tool I wrote allows you to change an entire gallery with one click, although you will have to let it run in the browser for a little bit while it does its work.

    Matt
  • NimaiNimai Registered Users Posts: 564 Major grins
    edited September 19, 2007
    mattwright wrote:
    Nice! Correct me if I'm wrong, but it appears that your code still requires one to navigate to each individual image page? The tool I wrote allows you to change an entire gallery with one click, although you will have to let it run in the browser for a little bit while it does its work.

    Matt
    I only used mine with the Thumbnail view, and then I adjust each squares position and maybe size as needed. Sounds like yours is a bit different! I'll have to check it out!
  • brandofamilybrandofamily Registered Users Posts: 2,013 Major grins
    edited September 24, 2007
    I'm trying a gallery w/ 9 pics.... seems to be taking forever...ne_nau.gif
  • mattwrightmattwright Registered Users Posts: 124 Major grins
    edited September 27, 2007
    I'm trying a gallery w/ 9 pics.... seems to be taking forever...ne_nau.gif

    It normally takes a few seconds per photo, but this still beats having to navigate to each page manually and crop the photo. Sometimes if smugmug's servers are slow, it can take longer. Is it going a lot slower than that for you?
  • brandofamilybrandofamily Registered Users Posts: 2,013 Major grins
    edited September 27, 2007
    mattwright wrote:
    It normally takes a few seconds per photo, but this still beats having to navigate to each page manually and crop the photo. Sometimes if smugmug's servers are slow, it can take longer. Is it going a lot slower than that for you?
    9 pics... ran for over an hour... never worked...
  • maikenmaiken Registered Users Posts: 55 Big grins
    edited September 30, 2007
    Real stupid question and I probably shouldn't be messing with this with my limited knowledge of code, but I like the idea of this add-on.

    I went to the Firefox site and downloaded the Greasemonkey extension, but I can't figure out how to install it. I get this error message:

    "Windows cannot open this file: To open this file, Windows needs to know what program created it" and asks to luse the web service to find the appropriate program.

    What am I doing wrong?
  • AllenAllen Registered Users Posts: 10,013 Major grins
    edited September 30, 2007
    maiken wrote:
    Real stupid question and I probably shouldn't be messing with this with my limited knowledge of code, but I like the idea of this add-on.

    I went to the Firefox site and downloaded the Greasemonkey extension, but I can't figure out how to install it. I get this error message:

    "Windows cannot open this file: To open this file, Windows needs to know what program created it" and asks to luse the web service to find the appropriate program.

    What am I doing wrong?
    If it's like any other extension you click "install now", restart Firfox and look for it
    under the tools menu at the top.
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • maikenmaiken Registered Users Posts: 55 Big grins
    edited September 30, 2007
    I downloaded it and clicked on the downloaded file and it gave me the error.

    No install now botton.
  • AllenAllen Registered Users Posts: 10,013 Major grins
    edited September 30, 2007
    maiken wrote:
    I downloaded it and clicked on the downloaded file and it gave me the error.

    No install now botton.
    Did you go to this page and click install now?

    https://addons.mozilla.org/en-US/firefox/addon/748
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • maikenmaiken Registered Users Posts: 55 Big grins
    edited September 30, 2007
    Allen wrote:
    Did you go to this page and click install now?

    https://addons.mozilla.org/en-US/firefox/addon/748

    Yes, and it pops up a new window saying file type unknown. I also downloaded and clicked on downloaded file and I get the same message.

    Who knows??
  • mattwrightmattwright Registered Users Posts: 124 Major grins
    edited September 30, 2007
    maiken wrote:
    Yes, and it pops up a new window saying file type unknown. I also downloaded and clicked on downloaded file and I get the same message.
    Just want to double check -- you are sure you are using the Firefox web browser (not Internet Explorer) and version 1.5 or above? You can go to the "Help" menu in Firefox and then "About" to determine which version you are using.

    Then you should just be able to click the Install Now button and an install dialog would popup, as a previous poster mentioned. I don't see why a recent version of Firefox would be giving you a file type unknown error.

    Matt
  • maikenmaiken Registered Users Posts: 55 Big grins
    edited September 30, 2007
    Your right. I was using IE to install. It was late and I had been working on the site all night so I didn't realize it.

    Sorry, but thanks for helping.
  • maikenmaiken Registered Users Posts: 55 Big grins
    edited September 30, 2007
    This program is BRILLIANT!!!!!

    What a time saver and it works so fast. I started a 400 image gallery about 10 minutes ago and it's already 1/4 of the way through.

    Thanks for doing this...
  • brandofamilybrandofamily Registered Users Posts: 2,013 Major grins
    edited September 30, 2007
    Hey Matt, the squares turned yellow, but never green... I refreshed the page a few hours later... the zooms were done! The only issue I have is that the zoom is always centered in the pic... but that works for most images...
  • mattwrightmattwright Registered Users Posts: 124 Major grins
    edited October 1, 2007
    Re: squares turning yellow + centered zooms
    Hey Matt, the squares turned yellow, but never green... I refreshed the page a few hours later... the zooms were done! The only issue I have is that the zoom is always centered in the pic... but that works for most images...

    Although it does center the thumbnail, as you say, that works for most images and then you can go in and manually zoom the thumbnail for those where a different crop works best. I wanted a way to quickly zoom all images to 1:1 for new galleries I added and then manually zoom those specific images where it was needed.

    Glad it did eventually work even though it didn't appear to! :) It is possible that the callback for when the zoom is completed failed on the pages being returned by smugmug to the script (the script looks for a specific string: "/cart/batchadd.mg?ImageID=##")

    As a general rule, once a box has turned yellow, the request for zooming that thumbnail has been sent to smugmug and should be completed several seconds later. If you see all boxes turn yellow, I guess there is some completion detection failure, but most likely the zooms have all been processed.

    Matt
  • jchinjchin Registered Users Posts: 713 Major grins
    edited November 26, 2007
    Works great! thumb.gif

    Personally I find this greasemonkey script works better than the "bulk zoom thumbnail" hack that can be found on this tread:
    http://www.dgrin.com/showthread.php?t=26959

    Thanks. Now if only SmugMug would incorporate something like this into their uploader procedure.
    Johnny J. Chin ~ J. Chin Photography
    FacebookFlickrSmugMug
    SmugMug referral coupon code: ix3uDyfBU6xXs
    (use this for a discount off your SmugMug subscription)
  • jchinjchin Registered Users Posts: 713 Major grins
    edited December 19, 2007
    Can someone tell me if the code can be modified so that vertical photos when 1x1 bulk zoomed, can be set so that it is say more to the top of the photo?

    I really hate it when I have vertical photos and everyone's heads get cut-off in the zoomed thumbanil, which then means manually changing each photo.

    Thanks.
    Johnny J. Chin ~ J. Chin Photography
    FacebookFlickrSmugMug
    SmugMug referral coupon code: ix3uDyfBU6xXs
    (use this for a discount off your SmugMug subscription)
  • mattwrightmattwright Registered Users Posts: 124 Major grins
    edited December 20, 2007
    A possible modification
    jchin wrote:
    Can someone tell me if the code can be modified so that vertical photos when 1x1 bulk zoomed, can be set so that it is say more to the top of the photo?
    Hi jchin,

    Currently it doesn't do that, but it could be modified to do so. I haven't tested this modification, but feel free to try it out yourself. In the function unsafeWindow.processImageDetails you will see a line that looks like:

    yOffset = parseInt((imgHeight - newHeight) / 2);

    Change this to:

    yOffset = 0;

    The original line is setting the starting vertical offset of the new crop area to be 1/2 of what is being removed from the image (therefore centering it), but the change will simply keep the crop at the top of the image.

    Matt
  • jchinjchin Registered Users Posts: 713 Major grins
    edited December 20, 2007
    mattwright wrote:
    Hi jchin,

    Currently it doesn't do that, but it could be modified to do so. I haven't tested this modification, but feel free to try it out yourself. In the function unsafeWindow.processImageDetails you will see a line that looks like:

    yOffset = parseInt((imgHeight - newHeight) / 2);

    Change this to:

    yOffset = 0;

    The original line is setting the starting vertical offset of the new crop area to be 1/2 of what is being removed from the image (therefore centering it), but the change will simply keep the crop at the top of the image.

    Matt

    Thanks Matt. I'll give that a try.
    Does this affect the horizontal photos?
    Johnny J. Chin ~ J. Chin Photography
    FacebookFlickrSmugMug
    SmugMug referral coupon code: ix3uDyfBU6xXs
    (use this for a discount off your SmugMug subscription)
  • mattwrightmattwright Registered Users Posts: 124 Major grins
    edited December 20, 2007
    jchin wrote:
    Thanks Matt. I'll give that a try.
    Does this affect the horizontal photos?
    Not as long as you are resizing to a ratio of 1:1... You will see that the section of code I told you to modify is enclosed in this if statement:

    if (imgWidth / ratio_w < imgHeight / ratio_h) {

    which basically will only effect images where the width is less than the height.

    Matt
  • jchinjchin Registered Users Posts: 713 Major grins
    edited December 20, 2007
    Matt,

    Thanks a very large bunch!

    Instead of using:
    yOffset = 0;

    I used, instead:
    yOffset = parseInt((imgHeight - newHeight) / 4);

    And on my test gallery, it worked wonderfully.
    Thanks a bunch!

    Merry Christmas!

    - Johnny
    Johnny J. Chin ~ J. Chin Photography
    FacebookFlickrSmugMug
    SmugMug referral coupon code: ix3uDyfBU6xXs
    (use this for a discount off your SmugMug subscription)
  • lynnesitelynnesite Registered Users Posts: 747 Major grins
    edited December 28, 2007
    Hey there Matt,
    Using FF 2.0.0.11, greasemonkey installed and enabled. Your script installed. I can right click, and select it. But it never does anything.

    I even made it private, turned originals on and protection off. Same thing.

    Any ideas? ETA: I did turn popups on first and set to all thumbs.
  • milemile Registered Users Posts: 5 Beginner grinner
    edited December 31, 2007
    User script Command disabled
    HI Matt,

    I installed your script but I can't get the 'User script Command' enabled
    so have no chance to run it.

    Greasemonkey and 'Smugmug: Bulk Zoom...' are enabled.
    Gallery style in smugmug: all thumbs

    Any ideas?

    Thanks a lot!

    Michael

    FF 2.0.0.11
    greasemonkey-0.7.20070607.0-fx.xpi
    WIN XP
  • jchinjchin Registered Users Posts: 713 Major grins
    edited January 8, 2008
    mile wrote:
    HI Matt,

    I installed your script but I can't get the 'User script Command' enabled
    so have no chance to run it.

    Greasemonkey and 'Smugmug: Bulk Zoom...' are enabled.
    Gallery style in smugmug: all thumbs

    Any ideas?

    Thanks a lot!

    Michael

    FF 2.0.0.11
    greasemonkey-0.7.20070607.0-fx.xpi
    WIN XP

    Did you try restarting Firefox?
    Johnny J. Chin ~ J. Chin Photography
    FacebookFlickrSmugMug
    SmugMug referral coupon code: ix3uDyfBU6xXs
    (use this for a discount off your SmugMug subscription)
  • milemile Registered Users Posts: 5 Beginner grinner
    edited January 10, 2008
    jchin wrote:
    Did you try restarting Firefox?
    Yes, didn't help. I checked the error console of FF and found an error in addon js for greasmonkey 0.7.2. So I uninstalled it and installed previous version 0.6.9. Now everything is fine wings.gif.
    Thanks,

    Michael
  • jasonscottphotojasonscottphoto Registered Users Posts: 711 Major grins
    edited January 28, 2008
    worked before but not now
    I was successfully using this greasemonkey script for quite a while but when I tried yesterday it just sits there with a grid of grey boxes and nothing changes color.

    I updated my Mac OS to Leopard recently, and I don't know if FF has been updated... those are the only things I can think of that would be different but why would that effect something that works from within the browser?

    Any thoughts?
    Posts by Allyson, the wife/assistant...

    Jason Scott Photography | Blog | FB | Twitter | Google+ | Tumblr | Instagram | YouTube
Sign In or Register to comment.