<div dir="ltr">The following patch avoids me various TypeError errors, probably due to comparison including no-image files<div><br></div><div>It adds the 1600 thumbnail too, but it still is to be activated in js</div><div><br></div><div><div><font face="monospace, monospace">---------------------------- scanner/PhotoAlbum.py ----------------------------</font></div><div><font face="monospace, monospace">index 372ef32..9ef1a6a 100644</font></div><div><font face="monospace, monospace">@@ -39,7 +39,10 @@ class Album(object):</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">                    </span>return self._photos[-1].date</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">          </span>return max(self._photos[-1].date, self._albums[-1].date)</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">      </span>def __cmp__(self, other):</font></div><div><font face="monospace, monospace">-<span class="gmail-Apple-tab-span" style="white-space:pre">              </span>return cmp(self.date, other.date)</font></div><div><font face="monospace, monospace">+<span class="gmail-Apple-tab-span" style="white-space:pre">              </span>try:</font></div><div><font face="monospace, monospace">+<span class="gmail-Apple-tab-span" style="white-space:pre">                   </span>return cmp(self.date, other.date)</font></div><div><font face="monospace, monospace">+<span class="gmail-Apple-tab-span" style="white-space:pre">              </span>except TypeError:</font></div><div><font face="monospace, monospace">+<span class="gmail-Apple-tab-span" style="white-space:pre">                      </span>return 1</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">      </span>def add_photo(self, photo):</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">           </span>self._photos.append(photo)</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">            </span>self._photos_sorted = False</font></div><div><font face="monospace, monospace">@@ -104,7 +107,8 @@ class Album(object):</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">             </span>return None</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">   </span></font></div><div><font face="monospace, monospace"> class Photo(object):</font></div><div><font face="monospace, monospace">-<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>thumb_sizes = [ (75, True), (150, True), (640, False), (800, False), (1024, False) ]</font></div><div><font face="monospace, monospace">+<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>thumb_sizes = [ (75, True), (150, True), (640, False), (800, False), (1024, False), (1600, False) ]</font></div><div><font face="monospace, monospace">+<span class="gmail-Apple-tab-span" style="white-space:pre">    #</span>thumb_sizes = [ (75, True), (150, True), (1600, False) ]</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">     </span>def __init__(self, path, thumb_path=None, attributes=None):</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">           </span>self._path = trim_base(path)</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">          </span>self.is_valid = True</font></div><div><font face="monospace, monospace">@@ -326,7 +330,10 @@ class Photo(object):</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">           </span>return correct_date</font></div><div><font face="monospace, monospace"> </font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">   </span>def __cmp__(self, other):</font></div><div><font face="monospace, monospace">-<span class="gmail-Apple-tab-span" style="white-space:pre">              </span>date_compare = cmp(self.date, other.date)</font></div><div><font face="monospace, monospace">+<span class="gmail-Apple-tab-span" style="white-space:pre">              </span>try:</font></div><div><font face="monospace, monospace">+<span class="gmail-Apple-tab-span" style="white-space:pre">                   </span>date_compare = cmp(self.date, other.date)</font></div><div><font face="monospace, monospace">+<span class="gmail-Apple-tab-span" style="white-space:pre">              </span>except TypeError:</font></div><div><font face="monospace, monospace">+<span class="gmail-Apple-tab-span" style="white-space:pre">                      </span>date_compare = 1</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">              </span>if date_compare == 0:</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">                 </span>return cmp(<a href="http://self.name">self.name</a>, <a href="http://other.name">other.name</a>)</font></div><div><font face="monospace, monospace"> <span class="gmail-Apple-tab-span" style="white-space:pre">          </span>return date_compare</font></div><div><div class="gmail_signature"><div dir="ltr"><div><br><br></div><div><br></div><div><br></div><div>Paolo Benvenuto</div></div></div></div>
</div></div>