added support for "hidden" property
This commit is contained in:
parent
55366a9aa7
commit
97d040cf32
2 changed files with 12 additions and 11 deletions
|
|
@ -318,14 +318,20 @@ public class DirectoryEntry extends Entry {
|
|||
thumbnail.setOrientation(Integer.parseInt(props.getProperty("file." + name + ".orientation")));
|
||||
thumbnail.setEtag(props.getProperty("file." + name + ".etag"));
|
||||
entry.setThumbnail(thumbnail);
|
||||
children.add(entry);
|
||||
if (name != null && name.equals(coverFileName)) {
|
||||
setThumbnail(thumbnail);
|
||||
boolean hidden = Boolean.parseBoolean(props.getProperty("file." + name + ".hidden"));
|
||||
if (!hidden) {
|
||||
children.add(entry);
|
||||
if (name != null && name.equals(coverFileName)) {
|
||||
setThumbnail(thumbnail);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (key.startsWith("dir.")) {
|
||||
} else if (key.startsWith("dir.") && !key.endsWith(".hidden")) {
|
||||
String name = key.substring("dir.".length());
|
||||
children.add(new DirectoryEntry(this, new File(file, name)));
|
||||
boolean hidden = Boolean.parseBoolean(props.getProperty("dir." + name + ".hidden"));
|
||||
if (!hidden) {
|
||||
children.add(new DirectoryEntry(this, new File(file, name)));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (thumbnail == null && !children.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -3,19 +3,14 @@ package org.forkalsrud.album.web;
|
|||
import java.awt.Graphics2D;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.AffineTransformOp;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
|
||||
import javax.imageio.IIOImage;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.ImageReadParam;
|
||||
import javax.imageio.ImageReader;
|
||||
import javax.imageio.ImageTypeSpecifier;
|
||||
import javax.imageio.ImageWriteParam;
|
||||
import javax.imageio.ImageWriter;
|
||||
import javax.imageio.stream.ImageInputStream;
|
||||
import javax.imageio.stream.ImageOutputStream;
|
||||
|
|
@ -131,7 +126,7 @@ public class AlbumServlet
|
|||
return false;
|
||||
}
|
||||
|
||||
void scaleImage(HttpServletRequest req, HttpServletResponse res, File file, Thumbnail thumbnail, String size) throws IOException {
|
||||
synchronized void scaleImage(HttpServletRequest req, HttpServletResponse res, File file, Thumbnail thumbnail, String size) throws IOException {
|
||||
|
||||
String fileEtag = thumbnail.getEtag() + "-" + size;
|
||||
if (etagMatches(req, fileEtag)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue