Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support jpeg and jpg formats #2886

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

BaharWeb
Copy link
Contributor

Creating a jpg or jpeg from a jasper template is not possible. The error is "Format 'jpg' with mapExport 'false' not supported"

@sbrunner
Copy link
Member

Looking at the CI it didn't look to work...

@BaharWeb BaharWeb force-pushed the Support-jpeg-ouputFormat branch from b6c2c72 to 79e4f54 Compare March 30, 2023 09:29
@BaharWeb
Copy link
Contributor Author

Looking at the CI it didn't look to work...

new chages were made hopefully the problem is fixed

@sbrunner
Copy link
Member

Hello, dans les tests, j'ai toujours l'erreur

#23 0.264 org.mapfish.print.output.JasperReportOutputFormatSimpleMapTest > testAllOutputFormats FAILED
#23 0.264     java.lang.RuntimeException: Image format not supported: jpg
#23 0.264         at org.mapfish.print.ImageUtils.writeImage(ImageUtils.java:44)
#23 0.264         at org.mapfish.print.output.JasperReportImageOutputFormat.doExport(JasperReportImageOutputFormat.java:89)
#23 0.264         at org.mapfish.print.output.AbstractJasperReportOutputFormat.print(AbstractJasperReportOutputFormat.java:103)
#23 0.264         at org.mapfish.print.output.JasperReportOutputFormatSimpleMapTest.testAllOutputFormats(JasperReportOutputFormatSimpleMapTest.java:59)

@m1dst
Copy link

m1dst commented Mar 31, 2023

@m1dst
Copy link

m1dst commented Mar 31, 2023

Neither @BaharWeb nor I have a build environment for this so for the time being I guess this is stuck until someone with an environment can investigate.

@sbrunner
Copy link
Member

Shouldn't you add && format.getFileSuffix().equals("jpg")) here:

@sbrunner sbrunner force-pushed the Support-jpeg-ouputFormat branch 3 times, most recently from 90f08c0 to 54ec8f5 Compare January 25, 2024 16:08
@sbrunner sbrunner requested a review from sebr72 January 25, 2024 16:23
Copy link
Contributor

@sebr72 sebr72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add at least one test to cover 1 of the JasperReportImageOutputFormat jpg...

@sbrunner sbrunner force-pushed the Support-jpeg-ouputFormat branch 8 times, most recently from e254ef0 to 00ae85f Compare January 26, 2024 15:19
@sbrunner sbrunner force-pushed the Support-jpeg-ouputFormat branch from 00ae85f to 480231b Compare January 26, 2024 15:27
Copy link
Contributor

@sebr72 sebr72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are most of the json files migrated to use png as the output format rather than pdf?
Shouldn't we add have test with pdf outputformat too ?

@sbrunner
Copy link
Member

sbrunner commented Jan 30, 2024

why are most of the json files migrated to use png as the output format rather than pdf?

Because I removed the changing output format hack:
https://github.com/mapfish/mapfish-print/pull/2886/files#diff-98111b9c985cc146d14603b605950f33d6314de138e48ad9b7ab1e07bcd2237cL263-L266

Shouldn't we add have test with pdf outputformat too?

It's the case :-) :

$ git grep -i '"outputFormat": "pd'  examples/
examples/src/test/resources/examples/mapexport/requestData-pdf.json:  "outputFormat": "pdf",
examples/src/test/resources/examples/simple/requestData-pdf.json:  "outputFormat": "pdf",

@sebr72
Copy link
Contributor

sebr72 commented Feb 5, 2024

Took the opportunity to remove the code that was turning the pdf into png

@sebr72 sebr72 enabled auto-merge February 5, 2024 08:46
@sbrunner sbrunner disabled auto-merge February 5, 2024 09:04
@sbrunner sbrunner merged commit 4e7a752 into mapfish:master Feb 5, 2024
2 checks passed
@geo-ghci-int geo-ghci-int bot added this to the 3.31.0 milestone Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants