# HG changeset patch # User Ingo Weinzierl # Date 1268032064 0 # Node ID 960ae818296ea28e94e1a0657c0904ff5aed08d8 # Parent 15af6e7ecf3a1410ce67b44bf97c6fae77308f40 img-Exports will get a file extension that corresponds to their mime-type (issue187). gnv/trunk@744 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 15af6e7ecf3a -r 960ae818296e gnv/ChangeLog --- a/gnv/ChangeLog Sat Mar 06 08:08:16 2010 +0000 +++ b/gnv/ChangeLog Mon Mar 08 07:07:44 2010 +0000 @@ -1,3 +1,12 @@ +2010-03-08 Ingo Weinzierl + + Issue187 + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Exports with + target 'img' will get a file extension that corresponds to their + mime-type. There was no code path for 'img' before, which caused the + problem, that 'img'-exports had a '.txt'-file extension. + 2010-03-06 Sascha L. Teichmann * src/main/java/de/intevation/gnv/action/DoExportAction.java: diff -r 15af6e7ecf3a -r 960ae818296e gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Sat Mar 06 08:08:16 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Mon Mar 08 07:07:44 2010 +0000 @@ -178,6 +178,9 @@ String fileName = "GNVEXPORT_" + System.currentTimeMillis() + "."; target = target.toLowerCase(); + log.debug("******************************************************"); + log.debug("TARGET: " + target); + log.debug("MIMETYPE: " + mimeType); if (target.equals("chart")) { fileName = fileName @@ -187,6 +190,10 @@ fileName = fileName + mimeType.substring(mimeType.indexOf("/") + 1); } + else if (target.equals("img")) { + fileName = fileName + + mimeType.substring(mimeType.indexOf("/") + 1); + } else if (target.equals("pdf")) { fileName = fileName + "pdf"; } else if (target.equals("svg")) {