mirror of https://github.com/perkeep/perkeep.git
server/camlistored/ui: relax requirements for thumber
We actually don't need to know the filename of an image for a valid thumber to be created, so this change is removing such a strict check, which was making foursquare venue photos not be displayed. Also fix broken initialization of the thumber in foursquare container. Change-Id: Iefb36fc403a3c1101d83f6af916b447e149f5acf
This commit is contained in:
parent
4e308e2244
commit
a2359a934f
|
@ -122,7 +122,7 @@ cam.BlobItemFoursquareContent.Handler = function(href, venueId, venueName, venue
|
|||
this.venueId_ = venueId;
|
||||
this.venueName_ = venueName;
|
||||
this.startDate_ = startDate;
|
||||
this.thumber_ = venuePhotoMeta ? new cam.Thumber.fromImageMeta(venuePhotoMeta) : null;
|
||||
this.thumber_ = venuePhotoMeta ? cam.Thumber.fromImageMeta(venuePhotoMeta) : null;
|
||||
};
|
||||
|
||||
cam.BlobItemFoursquareContent.Handler.prototype.getAspectRatio = function() {
|
||||
|
|
|
@ -31,7 +31,7 @@ cam.Thumber = function(pathname, opt_aspect) {
|
|||
cam.Thumber.SIZES = [64, 128, 256, 375, 500, 750, 1000, 1500, 2000];
|
||||
|
||||
cam.Thumber.fromImageMeta = function(imageMeta) {
|
||||
if (!imageMeta || !imageMeta.image || !imageMeta.blobRef || !imageMeta.file || !imageMeta.file.fileName) {
|
||||
if (!imageMeta || !imageMeta.image || !imageMeta.blobRef) {
|
||||
return null;
|
||||
}
|
||||
return new cam.Thumber(goog.string.subs('thumbnail/%s/%s', imageMeta.blobRef, (imageMeta.file && imageMeta.file.fileName) || imageMeta.blobRef + '.jpg'),
|
||||
|
|
Loading…
Reference in New Issue