The type of the thumbnail may be different from that of the entry

This commit is contained in:
Knut Forkalsrud 2013-01-01 16:32:16 -08:00
parent 2607138d2a
commit cce4db445d
3 changed files with 9 additions and 3 deletions

View file

@ -154,7 +154,7 @@ public class DirectoryEntry extends EntryWithChildren<Entry> {
File f = new File(file, name);
String type = props.getProperty("file." + name + ".type", "image");
FileEntry entry = new FileEntry(this, f, type);
Thumbnail thumbnail = new Thumbnail(f);
Thumbnail thumbnail = new Thumbnail(f, type);
entry.setCaption(props.getProperty("file." + name + ".caption"));
Date fileDate = sdf.parse(props.getProperty("file." + name + ".captureDate"));
if (fileDate.before(oldest)) {

View file

@ -16,10 +16,12 @@ public class Thumbnail {
int orientation;
String etag;
String duration;
String type;
public Thumbnail(File path) {
public Thumbnail(File path, String type) {
this.path = path;
this.type = type;
}
/**
@ -76,4 +78,8 @@ public class Thumbnail {
public void setDuration(String duration) {
this.duration = duration;
}
public String getType() {
return type;
}
}

View file

@ -108,7 +108,7 @@ $D(function() {
var gridDiv = $("<div class=\"grid\">\n"
+ " <span class=\"name\">" + entry.name + "</span><br/>\n"
+ " <div class=\"imgborder\"><a class=\"ss\" id=\"ent" + idx + "\" href=\"${base}" + entry.path + "?size=" + picSize + "\" title=\"" + entry.name + "\">"
+ "<img class=\"picture\" src=\"${base}" + (entry.type == "movie" ? entry.path + ".frame" : entry.path) + "?size=" + thmb + "\" border=\"0\" width=\"" + dim.w + "\" height=\"" + dim.h + "\"/></a></div>\n"
+ "<img class=\"picture\" src=\"${base}" + (entry.thumbtype == "movie" ? entry.path + ".frame" : entry.path) + "?size=" + thmb + "\" border=\"0\" width=\"" + dim.w + "\" height=\"" + dim.h + "\"/></a></div>\n"
+ "</div>\n");
var captionP = $("<p id=\"" + entry.name + "\" class=\"caption\"></p>\n");