Fix off by one error which missed the last photo on each page

Sat, 04 Sep 2010 19:42:00 +0000

author
andy
date
Sat, 04 Sep 2010 19:42:00 +0000
changeset 16
fab81164e2c9
parent 15
7e3e3eed8ebd
child 17
d1377fc46e5d

Fix off by one error which missed the last photo on each page

emin file | annotate | diff | comparison | revisions
     1.1 --- a/emin	Sat Aug 21 11:47:54 2010 +0000
     1.2 +++ b/emin	Sat Sep 04 19:42:00 2010 +0000
     1.3 @@ -22,7 +22,7 @@
     1.4   * Resize option
     1.5   * Rename option
     1.6   * Crop-to-thumb option
     1.7 - * Rotate by EXIF orientation
     1.8 + * Auto-rotate by EXIF orientation
     1.9   * Copy Lightbox stuff into place
    1.10   * Allow complete rollback if any failure (or on demand?)
    1.11  """
    1.12 @@ -58,9 +58,9 @@
    1.13  parser.add_option("--no-table", dest="USE_TABLE", action="store_false", default=True,
    1.14                    help="don't use an HTML table for thumbnail presentation: just let the thumbs flow into the browser window")
    1.15  verbgroup = OptionGroup(parser, "Verbosity control")
    1.16 -verbgroup.add_option("-V", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL",
    1.17 +verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL",
    1.18                       default=logging.INFO, help="print debug (very verbose) messages")
    1.19 -verbgroup.add_option("-Q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL",
    1.20 +verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL",
    1.21                       default=logging.INFO, help="be very quiet")
    1.22  parser.add_option_group(verbgroup)
    1.23  opts, args = parser.parse_args()
    1.24 @@ -448,7 +448,7 @@
    1.25      if pics_end >= len(imgs):
    1.26          pics_end = len(imgs) - 1
    1.27  
    1.28 -    PAGEPICS = sorted(imgsinfo.keys())[pics_start: pics_end]
    1.29 +    PAGEPICS = sorted(imgsinfo.keys())[pics_start: pics_end+1]
    1.30      PAGEPICNUMS = range(len(PAGEPICS))
    1.31      relthumbdir = opts.THUMBDIR
    1.32      #relthumbdir = os.path.relpath(THUMBDIR, OUTDIR)
    1.33 @@ -465,6 +465,7 @@
    1.34  
    1.35      logging.info("Writing to index file %s" % PAGEPATH)
    1.36      f = open(PAGEPATH, "w")
    1.37 +    logging.debug("Images on page: %s" % PAGEPICS)
    1.38      tdict = {}
    1.39      tdict["NUM_PAGES"] = NUM_PAGES
    1.40      tdict["NUM_PER_PAGE"] = NUM_PER_PAGE

mercurial