Skip to content

Commit

Permalink
Fix image issue with docx (#1549) and eclipse preview (#1550) (#1551)
Browse files Browse the repository at this point in the history
* Fix image issue with docx (#1549) and eclipse preview (#1550)
  • Loading branch information
speckyspooky authored Jan 24, 2024
1 parent 76af50f commit fa95ec0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ public Image getEmbeddedImage(ModuleHandle handle, String name) {
InputStream in = null;
try {
if (key.toLowerCase().endsWith(".svg") //$NON-NLS-1$
|| embeddedImage.getType(handle.getModule()).equalsIgnoreCase("image/svg+xml"))
|| embeddedImage.getType(handle.getModule()) != null
&& embeddedImage.getType(handle.getModule()).equalsIgnoreCase(URL_IMAGE_TYPE_SVG))
{
// convert svg image to JPEG image bytes
JPEGTranscoder jpegTranscoder = new JPEGTranscoder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1067,10 +1067,10 @@ public void startImage(IImageContent image) {
referenceHeight = imageInfo.getHeight();
height = WordUtil.convertImageSize(image.getHeight(), referenceHeight, PropertyUtil.getImageDpi(image, imageFileHeightDpi, 0));
}
if (image.getWidth() == null && height > 0) {
if (image.getWidth() == null && width == 0 && height > 0) {
width = height;
}
if (width > 0 && image.getHeight() == null) {
if (width > 0 && image.getHeight() == null && height == 0) {
height = width;
}

Expand Down Expand Up @@ -1385,7 +1385,6 @@ private void writeHeaderFooter() throws IOException, BirtException {
String backgroundWidth = style.getBackgroundWidth();

SimpleMasterPageDesign master = (SimpleMasterPageDesign) previousPage.getGenerateBy();

if (previousPage.getPageHeader() != null || backgroundHeight != null || backgroundWidth != null) {
wordWriter.startHeader(!master.isShowHeaderOnFirst() && previousPage.getPageNumber() == 1, headerHeight,
contentWidth);
Expand Down

0 comments on commit fa95ec0

Please sign in to comment.