[RFE] Converting to HTML doesn't honor ImageFormat in SaveOptions

Hi,
Version 8.0.2 exposed ImageOptions:
Converting Workbook to Different Formats|Documentation

However,
when saving the file, the images from the worksheet are always exported
in the original format regardless of the configured ImageFormat.

Also,
when using setExportImagesAsBase64(true), the images are converted with
very low resolution, actually it seems to be resized to a fixed maximum
size then stretched on display (the IMG tag).

public static void testImageExport() throws Exception
{
InputStream v_inputStream = ClassLoader.getSystemResourceAsStream(“TemplateTeste.xlsx”);
Workbook v_workbook = new Workbook(v_inputStream);
v_inputStream.close();
HtmlSaveOptions v_saveOptions = new HtmlSaveOptions();
v_saveOptions.getImageOptions().setImageFormat(ImageFormat.getPng());
v_saveOptions.setEncoding(Encoding.getUTF8NoBOM());
v_saveOptions.setExportActiveWorksheetOnly(true);
v_workbook.save(“output/teste.html”, v_saveOptions);
v_saveOptions.setExportImagesAsBase64(true);
v_workbook.save(“output/teste_base64.html”, v_saveOptions);
}


Best regards,
Flávio

Hi,


After an initial test, I observed the issue as you mentioned by using your sample code with your template file. The image format is still JPEG for one of the images in the spreadsheet. Also, we will check and investigate the issue when using setExportImagesAsBase64(true), the images are converted with very low resolution. I have logged a ticket with an id “CELLSJAVA-40866” for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.

Hi,


We are evaluating your issue, could you provide us details about the browser type you are using?

Thank you.

Hi,
I tested latest Firefox (30.0), IE (11.0.9600.17126), Chrome (35.0.1916.153), Thunderbird and Windows Live Mail.
Also, copying the BASE64 string from the HTML and decoding it confirms the problem (result from
http://base64converter.com attached).

Also, notice that when using setExportImagesAsBase64(), the image is always converted to PNG (i.e. even if I remove the setImageFormat call).

Hi,


Thanks for providing us details about the browser types and other details.

We have logged it against your issue into our database. We are already working over it.

Once we have any update on it, we will let you know here.

Thank you.

Hi,

Thanks for using Aspose.Cells.

Because IE Browser only supports 32k base64 image, when the size of base64 image is more than 32k, we will compress the base64 image, so that IE Browser can show the base64 image.

But other Browsers still use original base64 image.

Please download and try this fix: Aspose.Cells for Java 8.1.1.3.

Hi,
Confirmed all tests are working perfectly, thank you very much :slight_smile:

Best regards,
Flávio


Hi Flávio,


Thank you for the confirmation. Please feel free to write back in case you need our further assistance.

The issues you have found earlier (filed as CELLSJAVA-40866) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.