Bilder mit Neon 2 verwenden
ulrich
6 days ago 58f5c30897596a1139c579704ea9f92b62bc9bf9
fixFileName hinzugefuegt
1 files modified
7 ■■■■■ changed files
src/de/uhilger/neon/image/ImageFilter.java 7 ●●●●● patch | view | raw | blame | history
src/de/uhilger/neon/image/ImageFilter.java
@@ -20,6 +20,7 @@
import com.sun.net.httpserver.Filter;
import com.sun.net.httpserver.HttpExchange;
import de.uhilger.neon.FileServer;
import de.uhilger.neon.HttpHelper;
import java.io.IOException;
/**
@@ -68,6 +69,8 @@
    String pattern = (String) exchange.getHttpContext().getAttributes()
            .getOrDefault("imageFilterPattern", ".+\\.jpg|.+\\.jpeg|.+\\.png");
    String uriStr = exchange.getRequestURI().toString();
    try {
      String fName = new HttpHelper().getFileName(exchange);
    if(uriStr.toLowerCase().matches(pattern)) {
      String fileBase = (String) exchange.getHttpContext().getAttributes()
              .get(FileServer.ATTR_FILE_BASE);
@@ -80,8 +83,12 @@
                      .length());          
      new ImageWorker().createImages(fileBase, fileName, uriStr);
    }
    } catch(IllegalArgumentException ex) {
      // ungueltiger Dateiname, keine Transformation noetig, tue nichts
    } finally {
    chain.doFilter(exchange);
  }
  }
  @Override
  public String description() {