diff --git a/core/src/main/java/org/mapfish/print/ImageUtils.java b/core/src/main/java/org/mapfish/print/ImageUtils.java index 4b5b7a07d1..d22359e2e4 100644 --- a/core/src/main/java/org/mapfish/print/ImageUtils.java +++ b/core/src/main/java/org/mapfish/print/ImageUtils.java @@ -23,7 +23,10 @@ private ImageUtils() { public static void writeImage(final BufferedImage im, final String formatName, final File output) throws IOException { if (!ImageIO.write(im, formatName, output)) { - throw new RuntimeException("Image format not supported: " + formatName); + throw new RuntimeException( + String.format( + "Image format '%s' not supported, supported format: %s", + formatName, String.join(", ", ImageIO.getWriterFormatNames()))); } } @@ -39,7 +42,10 @@ public static void writeImage( final BufferedImage im, final String formatName, final OutputStream output) throws IOException { if (!ImageIO.write(im, formatName, output)) { - throw new RuntimeException("Image format not supported: " + formatName); + throw new RuntimeException( + String.format( + "Image format '%s' not supported, supported format: %s", + formatName, String.join(", ", ImageIO.getWriterFormatNames()))); } } } diff --git a/core/src/main/java/org/mapfish/print/output/JasperReportImageOutputFormat.java b/core/src/main/java/org/mapfish/print/output/JasperReportImageOutputFormat.java index 4636db574c..1c65b1d7ce 100644 --- a/core/src/main/java/org/mapfish/print/output/JasperReportImageOutputFormat.java +++ b/core/src/main/java/org/mapfish/print/output/JasperReportImageOutputFormat.java @@ -1,5 +1,6 @@ package org.mapfish.print.output; +import static java.util.Map.entry; import static org.mapfish.print.Constants.PDF_DPI; import java.awt.BasicStroke; @@ -10,6 +11,7 @@ import java.awt.image.BufferedImage; import java.io.IOException; import java.io.OutputStream; +import java.util.Map; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperPrintManager; @@ -19,7 +21,16 @@ public final class JasperReportImageOutputFormat extends AbstractJasperReportOutputFormat implements OutputFormat { - private int imageType = BufferedImage.TYPE_INT_ARGB; + // Use to get the image type from the output format + public static final Map IMAGE_TYPES = + Map.ofEntries( + entry("png", BufferedImage.TYPE_4BYTE_ABGR), + entry("jpg", BufferedImage.TYPE_3BYTE_BGR), + entry("jpeg", BufferedImage.TYPE_3BYTE_BGR), + entry("tif", BufferedImage.TYPE_4BYTE_ABGR), + entry("tiff", BufferedImage.TYPE_4BYTE_ABGR), + entry("gif", BufferedImage.TYPE_4BYTE_ABGR), + entry("bmp", BufferedImage.TYPE_3BYTE_BGR)); private String fileSuffix; @@ -49,13 +60,18 @@ protected void doExport(final OutputStream outputStream, final Print print) final int separatorHeight = 1; final int separatorHeightOnImage = (int) (separatorHeight * dpiRatio); + final int imageType = IMAGE_TYPES.get(getFileSuffix().toLowerCase()); BufferedImage reportImage = new BufferedImage( pageWidthOnImage, numPages * pageHeightOnImage + (numPages - 1) * separatorHeightOnImage, - this.imageType); - + imageType); Graphics2D graphics2D = reportImage.createGraphics(); + if (imageType != BufferedImage.TYPE_4BYTE_ABGR) { + graphics2D.setColor(Color.WHITE); + graphics2D.fillRect(0, 0, pageWidthOnImage, pageHeightOnImage); + } + try { JasperPrintManager printManager = JasperPrintManager.getInstance(print.context); @@ -89,13 +105,4 @@ protected void doExport(final OutputStream outputStream, final Print print) ImageUtils.writeImage(reportImage, getFileSuffix(), outputStream); } - - /** - * One of {@link java.awt.image.BufferedImage} TYPE_ values. - * - * @param imageType the buffered image type to create. - */ - public void setImageType(final int imageType) { - this.imageType = imageType; - } } diff --git a/core/src/main/java/org/mapfish/print/processor/map/CreateMapProcessor.java b/core/src/main/java/org/mapfish/print/processor/map/CreateMapProcessor.java index 663b2d9c32..aa02298659 100644 --- a/core/src/main/java/org/mapfish/print/processor/map/CreateMapProcessor.java +++ b/core/src/main/java/org/mapfish/print/processor/map/CreateMapProcessor.java @@ -2,6 +2,7 @@ import static org.geotools.renderer.lite.RendererUtilities.worldToScreenTransform; import static org.mapfish.print.Constants.PDF_DPI; +import static org.mapfish.print.output.JasperReportImageOutputFormat.IMAGE_TYPES; import com.codahale.metrics.MetricRegistry; import com.codahale.metrics.Timer; @@ -305,12 +306,11 @@ private URI createMergedGraphic( document.close(); } } else { - boolean isJpeg = RenderType.fromFileExtension(outputFormat) == RenderType.JPEG; - final BufferedImage bufferedImage = - new BufferedImage( - width, height, isJpeg ? BufferedImage.TYPE_3BYTE_BGR : BufferedImage.TYPE_4BYTE_ABGR); + + final int imageType = IMAGE_TYPES.get(outputFormat.toLowerCase()); + final BufferedImage bufferedImage = new BufferedImage(width, height, imageType); Graphics g = bufferedImage.getGraphics(); - if (isJpeg) { + if (imageType != BufferedImage.TYPE_4BYTE_ABGR) { g.setColor(Color.WHITE); g.fillRect(0, 0, width, height); } diff --git a/core/src/main/resources/mapfish-spring-config-output-formats.xml b/core/src/main/resources/mapfish-spring-config-output-formats.xml index 941c3d59bd..91d75998f2 100644 --- a/core/src/main/resources/mapfish-spring-config-output-formats.xml +++ b/core/src/main/resources/mapfish-spring-config-output-formats.xml @@ -7,6 +7,10 @@ + + + - - + + + diff --git a/core/src/test/java/org/mapfish/print/output/JasperReportOutputFormatSimpleMapTest.java b/core/src/test/java/org/mapfish/print/output/JasperReportOutputFormatSimpleMapTest.java index 9a03efecc1..9470793f5b 100644 --- a/core/src/test/java/org/mapfish/print/output/JasperReportOutputFormatSimpleMapTest.java +++ b/core/src/test/java/org/mapfish/print/output/JasperReportOutputFormatSimpleMapTest.java @@ -53,8 +53,10 @@ public void testAllOutputFormats() throws Exception { final PJsonObject requestData = loadJsonRequestData(); for (OutputFormat format : this.outputFormat.values()) { - if (format.getFileSuffix().equals("bmp")) { - // BMP does not support transparency + if ("bmp".equals(format.getFileSuffix()) + || "jpeg".equals(format.getFileSuffix()) + || "jpg".equals(format.getFileSuffix())) { + // BMP and JPEG do not support transparency continue; } final OutputStream outputStream = new ByteArrayOutputStream(); diff --git a/examples/src/test/java/org/mapfish/print/ExamplesTest.java b/examples/src/test/java/org/mapfish/print/ExamplesTest.java index 3530537f8f..bbb4c051d2 100644 --- a/examples/src/test/java/org/mapfish/print/ExamplesTest.java +++ b/examples/src/test/java/org/mapfish/print/ExamplesTest.java @@ -58,7 +58,7 @@ public class ExamplesTest { "classpath:mapfish-spring-application-context.xml"; public static final String TEST_SPRING_XML = "classpath:test-http-request-factory-application-context.xml"; - public static final String[] BITMAP_FORMATS = {"png", "jpeg", "tiff"}; + public static final String[] BITMAP_FORMATS = {"bmp", "png", "jpeg", "tiff", "jpg", "tif"}; private static final Logger LOGGER = LoggerFactory.getLogger(ExamplesTest.class); private static final String REQUEST_DATA_FILE = "requestData(-.*)?.json"; private static final String CONFIG_FILE = "config.yaml"; @@ -182,7 +182,7 @@ public void testAllExamples() { for (File example : Objects.requireNonNull(examplesDir.listFiles())) { if (example.isDirectory() && exampleFilter.matcher(example.getName()).matches()) { - testsRan += runExample(example, errors, true); + testsRan += runExample(example, errors); } } @@ -228,11 +228,11 @@ private void reportErrors(final Map errors, final int testsRa public void testPDFA() { final File examplesDir = getFile(ExamplesTest.class, "/examples"); Map errors = new HashMap<>(); - runExample(new File(examplesDir, "pdf_a_compliant"), errors, false); + runExample(new File(examplesDir, "pdf_a_compliant"), errors); reportErrors(errors, 1); } - private int runExample(File example, Map errors, boolean forceBitmap) { + private int runExample(File example, Map errors) { int testsRan = 0; try { final File configFile = new File(example, CONFIG_FILE); @@ -260,10 +260,6 @@ private int runExample(File example, Map errors, boolean forc testsRan++; String outputFormat = jsonSpec.getInternalObj().getString("outputFormat"); - if (forceBitmap && !ArrayUtils.contains(BITMAP_FORMATS, outputFormat)) { - jsonSpec.getInternalObj().put("outputFormat", "png"); - outputFormat = "png"; - } URL url = new URL( @@ -300,12 +296,14 @@ private int runExample(File example, Map errors, boolean forc } Map content_types = new HashMap(); + content_types.put("pdf", "application/pdf"); content_types.put("png", "image/png"); content_types.put("jpg", "image/jpeg"); content_types.put("jpeg", "image/jpeg"); content_types.put("tif", "image/tiff"); content_types.put("tiff", "image/tiff"); - content_types.put("pdf", "application/pdf"); + content_types.put("gif", "image/gif"); + content_types.put("bmp", "image/bmp"); Assert.equals(content_types.get(outputFormat), http.getHeaderField("Content-Type")); BufferedImage image = ImageIO.read(connection.getInputStream()); @@ -319,7 +317,10 @@ private int runExample(File example, Map errors, boolean forc new Exception("File not found: " + expectedOutput.toString())); } - new ImageSimilarity(expectedOutput).assertSimilarity(image); + if (!"bmp".equals(outputFormat)) { + // BMP is not supported by ImageIO + new ImageSimilarity(expectedOutput).assertSimilarity(image); + } } } } catch (Throwable e) { diff --git a/examples/src/test/resources/examples/add_overlay_layer/requestData-no-data-layer.json b/examples/src/test/resources/examples/add_overlay_layer/requestData-no-data-layer.json index 6fb4bc4ae8..586e7ad510 100644 --- a/examples/src/test/resources/examples/add_overlay_layer/requestData-no-data-layer.json +++ b/examples/src/test/resources/examples/add_overlay_layer/requestData-no-data-layer.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/add_overlay_layer/requestData-one-data-layer.json b/examples/src/test/resources/examples/add_overlay_layer/requestData-one-data-layer.json index 38da28fd6b..bc64a2e98a 100644 --- a/examples/src/test/resources/examples/add_overlay_layer/requestData-one-data-layer.json +++ b/examples/src/test/resources/examples/add_overlay_layer/requestData-one-data-layer.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/add_overlay_layer/requestData-override-overlay.json b/examples/src/test/resources/examples/add_overlay_layer/requestData-override-overlay.json index 38da28fd6b..bc64a2e98a 100644 --- a/examples/src/test/resources/examples/add_overlay_layer/requestData-override-overlay.json +++ b/examples/src/test/resources/examples/add_overlay_layer/requestData-override-overlay.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/config_aliases_defaults/requestData-landscape.json b/examples/src/test/resources/examples/config_aliases_defaults/requestData-landscape.json index e095a5e514..6236eaf6f8 100644 --- a/examples/src/test/resources/examples/config_aliases_defaults/requestData-landscape.json +++ b/examples/src/test/resources/examples/config_aliases_defaults/requestData-landscape.json @@ -2,7 +2,7 @@ "layout": "PDF Preview", "title": "dm[geo] map print", "outputFilename": "dmgeo-print", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "mainMap": { "dpi": "72", diff --git a/examples/src/test/resources/examples/config_aliases_defaults/requestData-portrait.json b/examples/src/test/resources/examples/config_aliases_defaults/requestData-portrait.json index 0101928b70..2cc5dcaea8 100644 --- a/examples/src/test/resources/examples/config_aliases_defaults/requestData-portrait.json +++ b/examples/src/test/resources/examples/config_aliases_defaults/requestData-portrait.json @@ -2,7 +2,7 @@ "layout": "PDF Preview portrait", "title": "dm[geo] map print", "outputFilename": "dmgeo-print", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "mainMap": { "dpi": "72", diff --git a/examples/src/test/resources/examples/crosses_point_grid/requestData-all-usa-states-with-crosses-grid.json b/examples/src/test/resources/examples/crosses_point_grid/requestData-all-usa-states-with-crosses-grid.json index beecd4ea62..c76f983a82 100644 --- a/examples/src/test/resources/examples/crosses_point_grid/requestData-all-usa-states-with-crosses-grid.json +++ b/examples/src/test/resources/examples/crosses_point_grid/requestData-all-usa-states-with-crosses-grid.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/crosses_point_grid/requestData-new-york-with-crosses-grid-22-degree-rotation.json b/examples/src/test/resources/examples/crosses_point_grid/requestData-new-york-with-crosses-grid-22-degree-rotation.json index 0d1a831d47..cb768963b3 100644 --- a/examples/src/test/resources/examples/crosses_point_grid/requestData-new-york-with-crosses-grid-22-degree-rotation.json +++ b/examples/src/test/resources/examples/crosses_point_grid/requestData-new-york-with-crosses-grid-22-degree-rotation.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/customDynamicReport/requestData.json b/examples/src/test/resources/examples/customDynamicReport/requestData.json index 5d01304b8b..578f9eb822 100644 --- a/examples/src/test/resources/examples/customDynamicReport/requestData.json +++ b/examples/src/test/resources/examples/customDynamicReport/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "number": 45, "name": "Hello", diff --git a/examples/src/test/resources/examples/data_uri_json/requestData-json-style-v2-not-svg.json b/examples/src/test/resources/examples/data_uri_json/requestData-json-style-v2-not-svg.json index cd0f9e0f4e..cb1bb0b9e6 100644 --- a/examples/src/test/resources/examples/data_uri_json/requestData-json-style-v2-not-svg.json +++ b/examples/src/test/resources/examples/data_uri_json/requestData-json-style-v2-not-svg.json @@ -74,5 +74,5 @@ } }, "layout": "A4 landscape", - "outputFormat": "pdf" + "outputFormat": "png" } diff --git a/examples/src/test/resources/examples/datasource_dynamic_tables/requestData-landscape.json b/examples/src/test/resources/examples/datasource_dynamic_tables/requestData-landscape.json index 666233014f..0e17d4cb63 100644 --- a/examples/src/test/resources/examples/datasource_dynamic_tables/requestData-landscape.json +++ b/examples/src/test/resources/examples/datasource_dynamic_tables/requestData-landscape.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "title": "Report title", "map": { diff --git a/examples/src/test/resources/examples/datasource_dynamic_tables/requestData-portrait.json b/examples/src/test/resources/examples/datasource_dynamic_tables/requestData-portrait.json index 3c22429eee..4e9be38dc2 100644 --- a/examples/src/test/resources/examples/datasource_dynamic_tables/requestData-portrait.json +++ b/examples/src/test/resources/examples/datasource_dynamic_tables/requestData-portrait.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "title": "Report title", "map": { diff --git a/examples/src/test/resources/examples/datasource_many_dynamictables_legend/requestData.json b/examples/src/test/resources/examples/datasource_many_dynamictables_legend/requestData.json index 41e2f461b5..43703061ac 100644 --- a/examples/src/test/resources/examples/datasource_many_dynamictables_legend/requestData.json +++ b/examples/src/test/resources/examples/datasource_many_dynamictables_legend/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "title": "", "comments": "", diff --git a/examples/src/test/resources/examples/datasource_multiple_maps/requestData.json b/examples/src/test/resources/examples/datasource_multiple_maps/requestData.json index 6add3a02c5..6f4bf94de1 100644 --- a/examples/src/test/resources/examples/datasource_multiple_maps/requestData.json +++ b/examples/src/test/resources/examples/datasource_multiple_maps/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "title": "Restaurants", "comments": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras egestas, massa eget placerat fermentum, nunc massa facilisis enim, id eleifend orci lacus sed sem.", diff --git a/examples/src/test/resources/examples/geoext/requestData.json b/examples/src/test/resources/examples/geoext/requestData.json index b51f96b331..d9de706986 100644 --- a/examples/src/test/resources/examples/geoext/requestData.json +++ b/examples/src/test/resources/examples/geoext/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "bbox": [100, -1, 106, 1.538], diff --git a/examples/src/test/resources/examples/http_processors/requestData.json b/examples/src/test/resources/examples/http_processors/requestData.json index 6c2dda7f04..eb502c0530 100644 --- a/examples/src/test/resources/examples/http_processors/requestData.json +++ b/examples/src/test/resources/examples/http_processors/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/image_layer_base64/requestData-layer-base64.json b/examples/src/test/resources/examples/image_layer_base64/requestData-layer-base64.json index 554e288bc4..4af6b10a63 100644 --- a/examples/src/test/resources/examples/image_layer_base64/requestData-layer-base64.json +++ b/examples/src/test/resources/examples/image_layer_base64/requestData-layer-base64.json @@ -19,6 +19,6 @@ ] } }, - "outputFormat": "pdf", + "outputFormat": "png", "layout": "A4 landscape" } diff --git a/examples/src/test/resources/examples/image_layer_test/requestData-with-error.json b/examples/src/test/resources/examples/image_layer_test/requestData-with-error.json index 4b083add43..574cfe5bd1 100644 --- a/examples/src/test/resources/examples/image_layer_test/requestData-with-error.json +++ b/examples/src/test/resources/examples/image_layer_test/requestData-with-error.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "bbox": [4150836.3839982115, 7600898.092677928, 5703147.34969658, 8257645.039704161], diff --git a/examples/src/test/resources/examples/image_layer_test/requestData.json b/examples/src/test/resources/examples/image_layer_test/requestData.json index f254e30ee7..06f3ecc9c2 100644 --- a/examples/src/test/resources/examples/image_layer_test/requestData.json +++ b/examples/src/test/resources/examples/image_layer_test/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "bbox": [4150836.3839982115, 7600898.092677928, 5703147.34969658, 8257645.039704161], diff --git a/examples/src/test/resources/examples/json_styling/requestData-json-style-line-v1.json b/examples/src/test/resources/examples/json_styling/requestData-json-style-line-v1.json index 3a7ff7c9c3..f5a9ae17af 100644 --- a/examples/src/test/resources/examples/json_styling/requestData-json-style-line-v1.json +++ b/examples/src/test/resources/examples/json_styling/requestData-json-style-line-v1.json @@ -204,5 +204,5 @@ } }, "layout": "A4 landscape", - "outputFormat": "pdf" + "outputFormat": "png" } diff --git a/examples/src/test/resources/examples/json_styling/requestData-json-style-line-v2.json b/examples/src/test/resources/examples/json_styling/requestData-json-style-line-v2.json index ab49aefbe1..73b3420d81 100644 --- a/examples/src/test/resources/examples/json_styling/requestData-json-style-line-v2.json +++ b/examples/src/test/resources/examples/json_styling/requestData-json-style-line-v2.json @@ -271,5 +271,5 @@ } }, "layout": "A4 landscape", - "outputFormat": "pdf" + "outputFormat": "png" } diff --git a/examples/src/test/resources/examples/json_styling/requestData-json-style-v2-not-svg.json b/examples/src/test/resources/examples/json_styling/requestData-json-style-v2-not-svg.json index e2c1b021f1..fcc59b475e 100644 --- a/examples/src/test/resources/examples/json_styling/requestData-json-style-v2-not-svg.json +++ b/examples/src/test/resources/examples/json_styling/requestData-json-style-v2-not-svg.json @@ -75,5 +75,5 @@ } }, "layout": "A4 landscape", - "outputFormat": "pdf" + "outputFormat": "png" } diff --git a/examples/src/test/resources/examples/legend/requestData.json b/examples/src/test/resources/examples/legend/requestData.json index f95f0fb29f..fb829866e1 100644 --- a/examples/src/test/resources/examples/legend/requestData.json +++ b/examples/src/test/resources/examples/legend/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "bbox": [100, -1, 106, 1.538], diff --git a/examples/src/test/resources/examples/legend_cropped/requestData.json b/examples/src/test/resources/examples/legend_cropped/requestData.json index 8d0f0d16d6..15d16e80f1 100644 --- a/examples/src/test/resources/examples/legend_cropped/requestData.json +++ b/examples/src/test/resources/examples/legend_cropped/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "bbox": [100, -1, 106, 1.538], diff --git a/examples/src/test/resources/examples/legend_dpi/requestData.json b/examples/src/test/resources/examples/legend_dpi/requestData.json index 966dc1d9b1..c3b048fff7 100644 --- a/examples/src/test/resources/examples/legend_dpi/requestData.json +++ b/examples/src/test/resources/examples/legend_dpi/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "bbox": [100, -1, 106, 1.538], diff --git a/examples/src/test/resources/examples/legend_scaled/requestData.json b/examples/src/test/resources/examples/legend_scaled/requestData.json index 8d0f0d16d6..15d16e80f1 100644 --- a/examples/src/test/resources/examples/legend_scaled/requestData.json +++ b/examples/src/test/resources/examples/legend_scaled/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "bbox": [100, -1, 106, 1.538], diff --git a/examples/src/test/resources/examples/mapexport/expected_output/requestData-bmp.bmp b/examples/src/test/resources/examples/mapexport/expected_output/requestData-bmp.bmp new file mode 100644 index 0000000000..d35cc2861a Binary files /dev/null and b/examples/src/test/resources/examples/mapexport/expected_output/requestData-bmp.bmp differ diff --git a/examples/src/test/resources/examples/mapexport/expected_output/requestData-jpg.jpeg b/examples/src/test/resources/examples/mapexport/expected_output/requestData-jpeg.jpeg similarity index 100% rename from examples/src/test/resources/examples/mapexport/expected_output/requestData-jpg.jpeg rename to examples/src/test/resources/examples/mapexport/expected_output/requestData-jpeg.jpeg diff --git a/examples/src/test/resources/examples/mapexport/expected_output/requestData_pdf.pdf b/examples/src/test/resources/examples/mapexport/expected_output/requestData-pdf.pdf similarity index 100% rename from examples/src/test/resources/examples/mapexport/expected_output/requestData_pdf.pdf rename to examples/src/test/resources/examples/mapexport/expected_output/requestData-pdf.pdf diff --git a/examples/src/test/resources/examples/mapexport/expected_output/requestData-png.png b/examples/src/test/resources/examples/mapexport/expected_output/requestData-png.png new file mode 100644 index 0000000000..058f055cb8 Binary files /dev/null and b/examples/src/test/resources/examples/mapexport/expected_output/requestData-png.png differ diff --git a/examples/src/test/resources/examples/mapexport/expected_output/requestData.png b/examples/src/test/resources/examples/mapexport/expected_output/requestData.png deleted file mode 100644 index 753b728746..0000000000 Binary files a/examples/src/test/resources/examples/mapexport/expected_output/requestData.png and /dev/null differ diff --git a/examples/src/test/resources/examples/mapexport/requestData-bmp.json b/examples/src/test/resources/examples/mapexport/requestData-bmp.json new file mode 100644 index 0000000000..cb2ba44d7c --- /dev/null +++ b/examples/src/test/resources/examples/mapexport/requestData-bmp.json @@ -0,0 +1,51 @@ +{ + "outputFormat": "bmp", + "layout": "plain", + "attributes": { + "map": { + "width": 780, + "height": 660, + "projection": "EPSG:3857", + "dpi": 72, + "rotation": 0, + "center": [-8233518.5005945, 4980320.4059228], + "scale": 25000, + "layers": [ + { + "type": "grid", + "gridType": "points", + "numberOfLines": [5, 5], + "renderAsSvg": true, + "haloColor": "#CCFFCC", + "labelColor": "black", + "labelFormat": "%1.0f %s", + "indent": 10, + "haloRadius": 4, + "font": { + "name": [ + "Liberation Sans", + "Helvetica", + "Nimbus Sans L", + "Liberation Sans", + "FreeSans", + "Sans-serif" + ], + "size": 8, + "style": "BOLD" + } + }, + { + "baseURL": "http://geoserver:8080/geoserver/wms", + "opacity": 1, + "type": "WMS", + "layers": ["tiger:tiger_roads"], + "imageFormat": "image/png", + "styles": ["line"], + "customParams": { + "TRANSPARENT": "true" + } + } + ] + } + } +} diff --git a/examples/src/test/resources/examples/mapexport/requestData-gif.json b/examples/src/test/resources/examples/mapexport/requestData-gif.json new file mode 100644 index 0000000000..78428dba63 --- /dev/null +++ b/examples/src/test/resources/examples/mapexport/requestData-gif.json @@ -0,0 +1,51 @@ +{ + "outputFormat": "gif", + "layout": "plain", + "attributes": { + "map": { + "width": 780, + "height": 660, + "projection": "EPSG:3857", + "dpi": 72, + "rotation": 0, + "center": [-8233518.5005945, 4980320.4059228], + "scale": 25000, + "layers": [ + { + "type": "grid", + "gridType": "points", + "numberOfLines": [5, 5], + "renderAsSvg": true, + "haloColor": "#CCFFCC", + "labelColor": "black", + "labelFormat": "%1.0f %s", + "indent": 10, + "haloRadius": 4, + "font": { + "name": [ + "Liberation Sans", + "Helvetica", + "Nimbus Sans L", + "Liberation Sans", + "FreeSans", + "Sans-serif" + ], + "size": 8, + "style": "BOLD" + } + }, + { + "baseURL": "http://geoserver:8080/geoserver/wms", + "opacity": 1, + "type": "WMS", + "layers": ["tiger:tiger_roads"], + "imageFormat": "image/png", + "styles": ["line"], + "customParams": { + "TRANSPARENT": "true" + } + } + ] + } + } +} diff --git a/examples/src/test/resources/examples/mapexport/requestData-jpg.json b/examples/src/test/resources/examples/mapexport/requestData-jpeg.json similarity index 50% rename from examples/src/test/resources/examples/mapexport/requestData-jpg.json rename to examples/src/test/resources/examples/mapexport/requestData-jpeg.json index b8f07fb90b..5f8e2a33a0 100644 --- a/examples/src/test/resources/examples/mapexport/requestData-jpg.json +++ b/examples/src/test/resources/examples/mapexport/requestData-jpeg.json @@ -11,6 +11,29 @@ "center": [-8233518.5005945, 4980320.4059228], "scale": 25000, "layers": [ + { + "type": "grid", + "gridType": "points", + "numberOfLines": [5, 5], + "renderAsSvg": true, + "haloColor": "#CCFFCC", + "labelColor": "black", + "labelFormat": "%1.0f %s", + "indent": 10, + "haloRadius": 4, + "font": { + "name": [ + "Liberation Sans", + "Helvetica", + "Nimbus Sans L", + "Liberation Sans", + "FreeSans", + "Sans-serif" + ], + "size": 8, + "style": "BOLD" + } + }, { "baseURL": "http://geoserver:8080/geoserver/wms", "opacity": 1, diff --git a/examples/src/test/resources/examples/mapexport/requestData_pdf.json b/examples/src/test/resources/examples/mapexport/requestData-pdf.json similarity index 100% rename from examples/src/test/resources/examples/mapexport/requestData_pdf.json rename to examples/src/test/resources/examples/mapexport/requestData-pdf.json diff --git a/examples/src/test/resources/examples/mapexport/requestData.json b/examples/src/test/resources/examples/mapexport/requestData-png.json similarity index 100% rename from examples/src/test/resources/examples/mapexport/requestData.json rename to examples/src/test/resources/examples/mapexport/requestData-png.json diff --git a/examples/src/test/resources/examples/mapexport/requestData-tiff.json b/examples/src/test/resources/examples/mapexport/requestData-tiff.json index fd6d98267b..a29b900443 100644 --- a/examples/src/test/resources/examples/mapexport/requestData-tiff.json +++ b/examples/src/test/resources/examples/mapexport/requestData-tiff.json @@ -11,6 +11,29 @@ "center": [-8233518.5005945, 4980320.4059228], "scale": 25000, "layers": [ + { + "type": "grid", + "gridType": "points", + "numberOfLines": [5, 5], + "renderAsSvg": true, + "haloColor": "#CCFFCC", + "labelColor": "black", + "labelFormat": "%1.0f %s", + "indent": 10, + "haloRadius": 4, + "font": { + "name": [ + "Liberation Sans", + "Helvetica", + "Nimbus Sans L", + "Liberation Sans", + "FreeSans", + "Sans-serif" + ], + "size": 8, + "style": "BOLD" + } + }, { "baseURL": "http://geoserver:8080/geoserver/wms", "opacity": 1, diff --git a/examples/src/test/resources/examples/merged_datasource/requestData.json b/examples/src/test/resources/examples/merged_datasource/requestData.json index 6118918ed7..14aa9b8cd0 100644 --- a/examples/src/test/resources/examples/merged_datasource/requestData.json +++ b/examples/src/test/resources/examples/merged_datasource/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "title": "Hello", "description": "Hello every body !", diff --git a/examples/src/test/resources/examples/multiple_maps/requestData.json b/examples/src/test/resources/examples/multiple_maps/requestData.json index 9fa1cddeb5..f029ccc3a7 100644 --- a/examples/src/test/resources/examples/multiple_maps/requestData.json +++ b/examples/src/test/resources/examples/multiple_maps/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "mapDef1": { "longitudeFirst": true, diff --git a/examples/src/test/resources/examples/native_mix/requestData.json b/examples/src/test/resources/examples/native_mix/requestData.json index 615c7d2242..e812b57a63 100644 --- a/examples/src/test/resources/examples/native_mix/requestData.json +++ b/examples/src/test/resources/examples/native_mix/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/overviewmap_tyger_ny_EPSG_3857/requestData-scale-wmts1_0_0-full-kvp.json b/examples/src/test/resources/examples/overviewmap_tyger_ny_EPSG_3857/requestData-scale-wmts1_0_0-full-kvp.json index dd678b2d18..d5ae51da96 100644 --- a/examples/src/test/resources/examples/overviewmap_tyger_ny_EPSG_3857/requestData-scale-wmts1_0_0-full-kvp.json +++ b/examples/src/test/resources/examples/overviewmap_tyger_ny_EPSG_3857/requestData-scale-wmts1_0_0-full-kvp.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/paging/requestData-multipoint.json b/examples/src/test/resources/examples/paging/requestData-multipoint.json index 107290aed4..9be3c29f38 100644 --- a/examples/src/test/resources/examples/paging/requestData-multipoint.json +++ b/examples/src/test/resources/examples/paging/requestData-multipoint.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/paging/requestData-polygon.json b/examples/src/test/resources/examples/paging/requestData-polygon.json index ca2bc77f78..9283ac7484 100644 --- a/examples/src/test/resources/examples/paging/requestData-polygon.json +++ b/examples/src/test/resources/examples/paging/requestData-polygon.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/pdf_a_compliant/requestData.json b/examples/src/test/resources/examples/pdf_a_compliant/requestData.json index 6b4e403465..e5f14f73a3 100644 --- a/examples/src/test/resources/examples/pdf_a_compliant/requestData.json +++ b/examples/src/test/resources/examples/pdf_a_compliant/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/print_osm_new_york_EPSG_3857/requestData-scale-osm.json b/examples/src/test/resources/examples/print_osm_new_york_EPSG_3857/requestData-scale-osm.json index 2ab5b25ad2..4b02185bf0 100644 --- a/examples/src/test/resources/examples/print_osm_new_york_EPSG_3857/requestData-scale-osm.json +++ b/examples/src/test/resources/examples/print_osm_new_york_EPSG_3857/requestData-scale-osm.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/print_osm_new_york_EPSG_3857/requestData-scale-rotate-osm.json b/examples/src/test/resources/examples/print_osm_new_york_EPSG_3857/requestData-scale-rotate-osm.json index 6e3aff1bf4..86de529654 100644 --- a/examples/src/test/resources/examples/print_osm_new_york_EPSG_3857/requestData-scale-rotate-osm.json +++ b/examples/src/test/resources/examples/print_osm_new_york_EPSG_3857/requestData-scale-rotate-osm.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/print_osm_new_york_nosubreports/requestData.json b/examples/src/test/resources/examples/print_osm_new_york_nosubreports/requestData.json index 2ab5b25ad2..4b02185bf0 100644 --- a/examples/src/test/resources/examples/print_osm_new_york_nosubreports/requestData.json +++ b/examples/src/test/resources/examples/print_osm_new_york_nosubreports/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/printtiledwms/requestData-bbox-auto-meta-tiled-wms1_1_1.json b/examples/src/test/resources/examples/printtiledwms/requestData-bbox-auto-meta-tiled-wms1_1_1.json index b986e9b83b..64bae72e70 100644 --- a/examples/src/test/resources/examples/printtiledwms/requestData-bbox-auto-meta-tiled-wms1_1_1.json +++ b/examples/src/test/resources/examples/printtiledwms/requestData-bbox-auto-meta-tiled-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "Auto meta tiling", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printtiledwms/requestData-bbox-auto-tiled-wms1_1_1.json b/examples/src/test/resources/examples/printtiledwms/requestData-bbox-auto-tiled-wms1_1_1.json index 023a69ec6d..df9ccc7d09 100644 --- a/examples/src/test/resources/examples/printtiledwms/requestData-bbox-auto-tiled-wms1_1_1.json +++ b/examples/src/test/resources/examples/printtiledwms/requestData-bbox-auto-tiled-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "Auto tiling", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printtiledwms/requestData-bbox-meta-tiled-wms1_1_1.json b/examples/src/test/resources/examples/printtiledwms/requestData-bbox-meta-tiled-wms1_1_1.json index 3fbf9e370f..3883add2b7 100644 --- a/examples/src/test/resources/examples/printtiledwms/requestData-bbox-meta-tiled-wms1_1_1.json +++ b/examples/src/test/resources/examples/printtiledwms/requestData-bbox-meta-tiled-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printtiledwms/requestData-bbox-tiled-wms1_1_1.json b/examples/src/test/resources/examples/printtiledwms/requestData-bbox-tiled-wms1_1_1.json index 059a3e64aa..3dbffcf5cb 100644 --- a/examples/src/test/resources/examples/printtiledwms/requestData-bbox-tiled-wms1_1_1.json +++ b/examples/src/test/resources/examples/printtiledwms/requestData-bbox-tiled-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printtiledwms/requestData-bbox-wms1_1_1.json b/examples/src/test/resources/examples/printtiledwms/requestData-bbox-wms1_1_1.json index b2d3c83ca3..41b25b24bd 100644 --- a/examples/src/test/resources/examples/printtiledwms/requestData-bbox-wms1_1_1.json +++ b/examples/src/test/resources/examples/printtiledwms/requestData-bbox-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printtiledwms/requestData-scale-tiled-wms1_1_1.json b/examples/src/test/resources/examples/printtiledwms/requestData-scale-tiled-wms1_1_1.json index b169a07674..91eee41863 100644 --- a/examples/src/test/resources/examples/printtiledwms/requestData-scale-tiled-wms1_1_1.json +++ b/examples/src/test/resources/examples/printtiledwms/requestData-scale-tiled-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printtiledwms/requestData-scale-wms1_1_1.json b/examples/src/test/resources/examples/printtiledwms/requestData-scale-wms1_1_1.json index 4425783a58..db8734d5c3 100644 --- a/examples/src/test/resources/examples/printtiledwms/requestData-scale-wms1_1_1.json +++ b/examples/src/test/resources/examples/printtiledwms/requestData-scale-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-bbox-wms1_1_1.json b/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-bbox-wms1_1_1.json index f2c1d397bf..5a5c63ba70 100644 --- a/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-bbox-wms1_1_1.json +++ b/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-bbox-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:26713", diff --git a/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-bbox-wms1_3_0.json b/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-bbox-wms1_3_0.json index ea5096a007..02eb129d2f 100644 --- a/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-bbox-wms1_3_0.json +++ b/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-bbox-wms1_3_0.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:26713", diff --git a/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-scale-wms1_1_1.json b/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-scale-wms1_1_1.json index 348349711d..b3616f5071 100644 --- a/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-scale-wms1_1_1.json +++ b/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-scale-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:26713", diff --git a/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-scale-wms1_3_0.json b/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-scale-wms1_3_0.json index 25f84bda3c..9c1a09a2f3 100644 --- a/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-scale-wms1_3_0.json +++ b/examples/src/test/resources/examples/printwms_SpearfishStreams_EPSG_26713/requestData-scale-wms1_3_0.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:26713", diff --git a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-native-rotate-wms1_3_0.json b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-native-rotate-wms1_3_0.json index c8048e9615..f7563d1010 100644 --- a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-native-rotate-wms1_3_0.json +++ b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-native-rotate-wms1_3_0.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-rotate-wms1_3_0.json b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-rotate-wms1_3_0.json index 435dbdc2a9..1f2e3246c9 100644 --- a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-rotate-wms1_3_0.json +++ b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-rotate-wms1_3_0.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-wms1_1_1.json b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-wms1_1_1.json index 981249de73..19946d4e0b 100644 --- a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-wms1_1_1.json +++ b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-wms1_3_0.json b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-wms1_3_0.json index caa3bd5164..6bf285c25e 100644 --- a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-wms1_3_0.json +++ b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-bbox-wms1_3_0.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-native-rotate-wms1_1_1.json b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-native-rotate-wms1_1_1.json index e876380e0d..d41276408f 100644 --- a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-native-rotate-wms1_1_1.json +++ b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-native-rotate-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-rotate-wms1_1_1.json b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-rotate-wms1_1_1.json index 0265c7f7e3..2124d24328 100644 --- a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-rotate-wms1_1_1.json +++ b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-rotate-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-wms1_1_1.json b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-wms1_1_1.json index 62e688da67..5ef4dd44a3 100644 --- a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-wms1_1_1.json +++ b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-wms1_1_1.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-wms1_3_0.json b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-wms1_3_0.json index 0d96979edb..6fcd1cf6c7 100644 --- a/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-wms1_3_0.json +++ b/examples/src/test/resources/examples/printwms_UsaPopulation_EPSG_4326/requestData-scale-wms1_3_0.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:4326", diff --git a/examples/src/test/resources/examples/printwms_archsites_server_type/requestData-scale-wms1_0_0-high-dpi.json b/examples/src/test/resources/examples/printwms_archsites_server_type/requestData-scale-wms1_0_0-high-dpi.json index 9f944787e2..366930d50f 100644 --- a/examples/src/test/resources/examples/printwms_archsites_server_type/requestData-scale-wms1_0_0-high-dpi.json +++ b/examples/src/test/resources/examples/printwms_archsites_server_type/requestData-scale-wms1_0_0-high-dpi.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:26713", diff --git a/examples/src/test/resources/examples/printwms_archsites_server_type/requestData-scale-wms1_0_0.json b/examples/src/test/resources/examples/printwms_archsites_server_type/requestData-scale-wms1_0_0.json index 27df04f4c3..de52fdb790 100644 --- a/examples/src/test/resources/examples/printwms_archsites_server_type/requestData-scale-wms1_0_0.json +++ b/examples/src/test/resources/examples/printwms_archsites_server_type/requestData-scale-wms1_0_0.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:26713", diff --git a/examples/src/test/resources/examples/printwms_background_layer/requestData-no-data-layer-300dpi.json b/examples/src/test/resources/examples/printwms_background_layer/requestData-no-data-layer-300dpi.json index 905a5e2cac..52068aba6a 100644 --- a/examples/src/test/resources/examples/printwms_background_layer/requestData-no-data-layer-300dpi.json +++ b/examples/src/test/resources/examples/printwms_background_layer/requestData-no-data-layer-300dpi.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/printwms_background_layer/requestData-no-data-layer.json b/examples/src/test/resources/examples/printwms_background_layer/requestData-no-data-layer.json index 6fb4bc4ae8..586e7ad510 100644 --- a/examples/src/test/resources/examples/printwms_background_layer/requestData-no-data-layer.json +++ b/examples/src/test/resources/examples/printwms_background_layer/requestData-no-data-layer.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/printwms_background_layer/requestData-one-data-layer.json b/examples/src/test/resources/examples/printwms_background_layer/requestData-one-data-layer.json index 38da28fd6b..bc64a2e98a 100644 --- a/examples/src/test/resources/examples/printwms_background_layer/requestData-one-data-layer.json +++ b/examples/src/test/resources/examples/printwms_background_layer/requestData-one-data-layer.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/printwms_background_layer/requestData-override-background.json b/examples/src/test/resources/examples/printwms_background_layer/requestData-override-background.json index ca402bda06..30acd262c4 100644 --- a/examples/src/test/resources/examples/printwms_background_layer/requestData-override-background.json +++ b/examples/src/test/resources/examples/printwms_background_layer/requestData-override-background.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-multi-layer-openlayers-2-compatible-style-wms.json b/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-multi-layer-openlayers-2-compatible-style-wms.json index 4af3cb99cd..2e137dd202 100644 --- a/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-multi-layer-openlayers-2-compatible-style-wms.json +++ b/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-multi-layer-openlayers-2-compatible-style-wms.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-rotate-wms1_0_0.json b/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-rotate-wms1_0_0.json index ea6e0072c3..17bf82a847 100644 --- a/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-rotate-wms1_0_0.json +++ b/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-rotate-wms1_0_0.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-wms1_0_0-high-dpi-svg-vector.json b/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-wms1_0_0-high-dpi-svg-vector.json index 7d578a7de2..066c829e29 100644 --- a/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-wms1_0_0-high-dpi-svg-vector.json +++ b/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-wms1_0_0-high-dpi-svg-vector.json @@ -26,5 +26,5 @@ } }, "layout": "A4 landscape", - "outputFormat": "pdf" + "outputFormat": "png" } diff --git a/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-wms1_0_0-high-dpi.json b/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-wms1_0_0-high-dpi.json index e0f35b4cf3..3e965150fb 100644 --- a/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-wms1_0_0-high-dpi.json +++ b/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-wms1_0_0-high-dpi.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-wms1_0_0.json b/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-wms1_0_0.json index ef87c70ecd..ad7962af6c 100644 --- a/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-wms1_0_0.json +++ b/examples/src/test/resources/examples/printwms_tyger_ny_EPSG_3857/requestData-scale-wms1_0_0.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/printwmts_tyger_ny_EPSG_3857/requestData-scale-rotate-wmts1_0_0-full-kvp.json b/examples/src/test/resources/examples/printwmts_tyger_ny_EPSG_3857/requestData-scale-rotate-wmts1_0_0-full-kvp.json index db06c0a2c1..74b2103e8b 100644 --- a/examples/src/test/resources/examples/printwmts_tyger_ny_EPSG_3857/requestData-scale-rotate-wmts1_0_0-full-kvp.json +++ b/examples/src/test/resources/examples/printwmts_tyger_ny_EPSG_3857/requestData-scale-rotate-wmts1_0_0-full-kvp.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/printwmts_tyger_ny_EPSG_3857/requestData-scale-wmts1_0_0-full-kvp.json b/examples/src/test/resources/examples/printwmts_tyger_ny_EPSG_3857/requestData-scale-wmts1_0_0-full-kvp.json index 4714ddf074..0ee0039c77 100644 --- a/examples/src/test/resources/examples/printwmts_tyger_ny_EPSG_3857/requestData-scale-wmts1_0_0-full-kvp.json +++ b/examples/src/test/resources/examples/printwmts_tyger_ny_EPSG_3857/requestData-scale-wmts1_0_0-full-kvp.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/report/requestData.json b/examples/src/test/resources/examples/report/requestData.json index 97668c19f9..142b4bf1a0 100644 --- a/examples/src/test/resources/examples/report/requestData.json +++ b/examples/src/test/resources/examples/report/requestData.json @@ -1,6 +1,6 @@ { "layout": "report", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "title": "Hello", "datasource": [ diff --git a/examples/src/test/resources/examples/request_rewrite/requestData.json b/examples/src/test/resources/examples/request_rewrite/requestData.json index f4ebeb96c8..e513917855 100644 --- a/examples/src/test/resources/examples/request_rewrite/requestData.json +++ b/examples/src/test/resources/examples/request_rewrite/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "width": 780, diff --git a/examples/src/test/resources/examples/resource_bundle/requestData-en.json b/examples/src/test/resources/examples/resource_bundle/requestData-en.json index 9949354a7d..ea946c674e 100644 --- a/examples/src/test/resources/examples/resource_bundle/requestData-en.json +++ b/examples/src/test/resources/examples/resource_bundle/requestData-en.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "lang": "en", "attributes": { "map": { diff --git a/examples/src/test/resources/examples/resource_bundle/requestData.json b/examples/src/test/resources/examples/resource_bundle/requestData.json index 0d236a68c5..fb363e1297 100644 --- a/examples/src/test/resources/examples/resource_bundle/requestData.json +++ b/examples/src/test/resources/examples/resource_bundle/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "lang": "fr_CH", "attributes": { "map": { diff --git a/examples/src/test/resources/examples/secured_templates/requestData.json b/examples/src/test/resources/examples/secured_templates/requestData.json index ef87c70ecd..ad7962af6c 100644 --- a/examples/src/test/resources/examples/secured_templates/requestData.json +++ b/examples/src/test/resources/examples/secured_templates/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples/simple/expected_output/requestData-bmp.bmp b/examples/src/test/resources/examples/simple/expected_output/requestData-bmp.bmp new file mode 100644 index 0000000000..fdc8426df2 Binary files /dev/null and b/examples/src/test/resources/examples/simple/expected_output/requestData-bmp.bmp differ diff --git a/examples/src/test/resources/examples/simple/expected_output/requestData-jpeg.jpeg b/examples/src/test/resources/examples/simple/expected_output/requestData-jpeg.jpeg new file mode 100644 index 0000000000..597b6c36c8 Binary files /dev/null and b/examples/src/test/resources/examples/simple/expected_output/requestData-jpeg.jpeg differ diff --git a/examples/src/test/resources/examples/simple/expected_output/requestData.png b/examples/src/test/resources/examples/simple/expected_output/requestData-png.png similarity index 100% rename from examples/src/test/resources/examples/simple/expected_output/requestData.png rename to examples/src/test/resources/examples/simple/expected_output/requestData-png.png diff --git a/examples/src/test/resources/examples/simple/expected_output/requestData-tiff.tiff b/examples/src/test/resources/examples/simple/expected_output/requestData-tiff.tiff new file mode 100644 index 0000000000..875a5b0688 Binary files /dev/null and b/examples/src/test/resources/examples/simple/expected_output/requestData-tiff.tiff differ diff --git a/examples/src/test/resources/examples/simple/requestData-bmp.json b/examples/src/test/resources/examples/simple/requestData-bmp.json new file mode 100644 index 0000000000..d554a0e741 --- /dev/null +++ b/examples/src/test/resources/examples/simple/requestData-bmp.json @@ -0,0 +1,35 @@ +{ + "layout": "A4 portrait", + "outputFormat": "bmp", + "attributes": { + "map": { + "longitudeFirst": true, + "center": [5, 45], + "scale": 100000000, + "projection": "EPSG:4326", + "dpi": 72, + "rotation": 0, + "layers": [ + { + "type": "geojson", + "geoJson": "file://countries.geojson", + "style": { + "version": "2", + "*": { + "symbolizers": [ + { + "type": "polygon", + "fillColor": "#5E7F99", + "fillOpacity": 1, + "strokeColor": "#CC1D18", + "strokeOpacity": 1, + "strokeWidth": 1 + } + ] + } + } + } + ] + } + } +} diff --git a/examples/src/test/resources/examples/simple/requestData-fontawesome.json b/examples/src/test/resources/examples/simple/requestData-fontawesome.json index 4d1c7687dc..2f1c9374aa 100644 --- a/examples/src/test/resources/examples/simple/requestData-fontawesome.json +++ b/examples/src/test/resources/examples/simple/requestData-fontawesome.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "title": "Font Awesome", "map": { diff --git a/examples/src/test/resources/examples/simple/requestData-jpeg.json b/examples/src/test/resources/examples/simple/requestData-jpeg.json new file mode 100644 index 0000000000..a1ac24ffa2 --- /dev/null +++ b/examples/src/test/resources/examples/simple/requestData-jpeg.json @@ -0,0 +1,35 @@ +{ + "layout": "A4 portrait", + "outputFormat": "jpeg", + "attributes": { + "map": { + "longitudeFirst": true, + "center": [5, 45], + "scale": 100000000, + "projection": "EPSG:4326", + "dpi": 72, + "rotation": 0, + "layers": [ + { + "type": "geojson", + "geoJson": "file://countries.geojson", + "style": { + "version": "2", + "*": { + "symbolizers": [ + { + "type": "polygon", + "fillColor": "#5E7F99", + "fillOpacity": 1, + "strokeColor": "#CC1D18", + "strokeOpacity": 1, + "strokeWidth": 1 + } + ] + } + } + } + ] + } + } +} diff --git a/examples/src/test/resources/examples/simple/requestData.json b/examples/src/test/resources/examples/simple/requestData-pdf.json similarity index 100% rename from examples/src/test/resources/examples/simple/requestData.json rename to examples/src/test/resources/examples/simple/requestData-pdf.json diff --git a/examples/src/test/resources/examples/simple/requestData-png.json b/examples/src/test/resources/examples/simple/requestData-png.json new file mode 100644 index 0000000000..87aad570c3 --- /dev/null +++ b/examples/src/test/resources/examples/simple/requestData-png.json @@ -0,0 +1,35 @@ +{ + "layout": "A4 portrait", + "outputFormat": "png", + "attributes": { + "map": { + "longitudeFirst": true, + "center": [5, 45], + "scale": 100000000, + "projection": "EPSG:4326", + "dpi": 72, + "rotation": 0, + "layers": [ + { + "type": "geojson", + "geoJson": "file://countries.geojson", + "style": { + "version": "2", + "*": { + "symbolizers": [ + { + "type": "polygon", + "fillColor": "#5E7F99", + "fillOpacity": 1, + "strokeColor": "#CC1D18", + "strokeOpacity": 1, + "strokeWidth": 1 + } + ] + } + } + } + ] + } + } +} diff --git a/examples/src/test/resources/examples/simple/requestData-tiff.json b/examples/src/test/resources/examples/simple/requestData-tiff.json new file mode 100644 index 0000000000..f7c5388b45 --- /dev/null +++ b/examples/src/test/resources/examples/simple/requestData-tiff.json @@ -0,0 +1,35 @@ +{ + "layout": "A4 portrait", + "outputFormat": "tiff", + "attributes": { + "map": { + "longitudeFirst": true, + "center": [5, 45], + "scale": 100000000, + "projection": "EPSG:4326", + "dpi": 72, + "rotation": 0, + "layers": [ + { + "type": "geojson", + "geoJson": "file://countries.geojson", + "style": { + "version": "2", + "*": { + "symbolizers": [ + { + "type": "polygon", + "fillColor": "#5E7F99", + "fillOpacity": 1, + "strokeColor": "#CC1D18", + "strokeOpacity": 1, + "strokeWidth": 1 + } + ] + } + } + } + ] + } + } +} diff --git a/examples/src/test/resources/examples/simple_A0/requestData.json b/examples/src/test/resources/examples/simple_A0/requestData.json index cdee1896ab..5b45217491 100644 --- a/examples/src/test/resources/examples/simple_A0/requestData.json +++ b/examples/src/test/resources/examples/simple_A0/requestData.json @@ -1,6 +1,6 @@ { "layout": "A0 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "longitudeFirst": true, diff --git a/examples/src/test/resources/examples/updatePdfMetadata/requestData.json b/examples/src/test/resources/examples/updatePdfMetadata/requestData.json index 43193e9bca..a3a2a6c628 100644 --- a/examples/src/test/resources/examples/updatePdfMetadata/requestData.json +++ b/examples/src/test/resources/examples/updatePdfMetadata/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "titleAtt": "From Client", "subjectAtt": "Mapfish Print Update PDF Metadata Example", diff --git a/examples/src/test/resources/examples/verboseExample/requestData.json b/examples/src/test/resources/examples/verboseExample/requestData.json index 70a902f775..6ff68f9b17 100644 --- a/examples/src/test/resources/examples/verboseExample/requestData.json +++ b/examples/src/test/resources/examples/verboseExample/requestData.json @@ -1,6 +1,6 @@ { "layout": "A4 portrait", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "number": 45, "name": "Hello", diff --git a/examples/src/test/resources/examples_to_port/print_tms_tyger_ny_EPSG_3857/requestData-scale-tms1_0_0.json b/examples/src/test/resources/examples_to_port/print_tms_tyger_ny_EPSG_3857/requestData-scale-tms1_0_0.json index 010ebf9048..06e96a359f 100644 --- a/examples/src/test/resources/examples_to_port/print_tms_tyger_ny_EPSG_3857/requestData-scale-tms1_0_0.json +++ b/examples/src/test/resources/examples_to_port/print_tms_tyger_ny_EPSG_3857/requestData-scale-tms1_0_0.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857", diff --git a/examples/src/test/resources/examples_to_port/print_vector_new_york_EPSG_3857/requestData-scale-vector.json b/examples/src/test/resources/examples_to_port/print_vector_new_york_EPSG_3857/requestData-scale-vector.json index e1294ad968..1a66526768 100644 --- a/examples/src/test/resources/examples_to_port/print_vector_new_york_EPSG_3857/requestData-scale-vector.json +++ b/examples/src/test/resources/examples_to_port/print_vector_new_york_EPSG_3857/requestData-scale-vector.json @@ -1,6 +1,6 @@ { "layout": "A4 landscape", - "outputFormat": "pdf", + "outputFormat": "png", "attributes": { "map": { "projection": "EPSG:3857",