I got an issue when tried to convert file from png to jpg. before convert to jpg I changed resolution, then I used “bos” to upload to server, but at that time the resolution is 96dpi
File file = new File("C:\\Temp\\input_test.png");
InputStream targetStream = new FileInputStream(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
rasterImageTmp.save("C:\\Temp\\output_test_1.jpg", new JpegOptions());
I checked, I replaced line 7 by
rasterImage.save(“C:\Temp\output_test.jpg”, new JpegOptions());
the output_test.jpg file is correct, the resolution is 15dpi
Anyone tell me know why? thank you for any support
Can you please try to use Aspose.Imaging latest version on your end. This will resolve your issue and if there is still an issue than please share generated result along with comparison screenshot so that we may further investigate to help you out.
I tested with aspose-imaging _19.11, I got the same issue. then I changed a little as below:
ResolutionSetting res = new ResolutionSetting();
res.setHorizontalResolution(20);
res.setVerticalResolution(20);
JpegOptions jpe = new JpegOptions();
jpe.setResolutionSettings(res);
The output result is correct, DPI is 20. but when I check from file by View Detail on Windows, DPI is 96, not 20.
I included input, output file, source file and test result in the attached file.
I have observed the issue shared by you and have created an issue with ID IMAGINGJAVA-1504 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
At the moment the issue is pending in our issues queue and we may not be able to comment if the two issues are relevant or not although seemingly they same similar from title. We request for your patience till the time the feedback is shared.
I have verified from our issue tracking system and regret to share that at present the issue is unresolved. We request for your patience till the time the issue gets resolved.