ONLYOFFICE / DesktopEditors

An office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents
https://www.onlyoffice.com
Other
2.76k stars 318 forks source link

OnlyOffice writer should honor the Resolution (intended printing size) of images. #1308

Closed mlell closed 10 months ago

mlell commented 1 year ago

This issue is unique.

Your idea.

Hello and thank you for this program, it is already really good!

I have noticed that OnlyOffice currently does not honor the dpi setting of images on import. In my case, I have to provide scientific plots in a resolution of 300dpi on request of the publisher. I generate them as PNG using R and get the following information using the imagemagick program:

$ identify -verbose herit.png
Image:
  Filename: herit.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: PseudoClass
  Geometry: 944x318+0+0
  Resolution: 118.11x118.11
  Print size: 7.99255x2.69241
  Units: PixelsPerCentimeter

So I see that the resolution is saved in the PNG file, probably in the pHYs header. When I insert the file in OnlyOffice, it gets loaded with a width of 24,98cm, however, which would be a resolution of ~38 pixels per centimeter, not the resolution shown in the output of identify. It would be very helpful if OnlyOffice would import the pictures in the correct resolution, because then it is possible to use homogenous font sizes in the plots and the text and it avoids the extra step of resizing the picture after import.

(P.S. I have searched the open and closed issues for "image resolution", "image dpi", "image insert size" and "dpi", without finding a related issue)

VladimirProkofiev52 commented 1 year ago

Hello! @mlell If I understood you correctly, after adding the image to the document, it has a small size.

Try after downloading the image, right-click on it and select "Actual size".

Will this fix your problem?

mlell commented 1 year ago

Hi, thank you for taking a look on this. No, the problem is just the inverse, the size is too large. For example, I add a PNG image where imagemagick's identify -verbose command tells me:

  Geometry: 944x708+0+0
  Resolution: 118.11x118.11
  Print size: 7.99255x5.99441
  Units: PixelsPerCentimeter

What I would expect is that after adding the image into a Writer document, it has dimensions of 8x6cm (like listed in the PNG file's "Print Size" metadata). However, after import I get a picture of size 16,5x12.38cm (filling the whole available page width). After selecting "original size", the picture expands to 24.98x18.73cm, outsizing the page.

It seems as if OnlyOffice assumes a hard-coded resolution (from the behaviour I would infer 37.76 px/cm or 96 dots per inch) instead of checking the metadata of the image and therefore makes pictures too large if they come in higher resolutions than that.

VladimirProkofiev52 commented 1 year ago

Please send one or more files on which you have the same problem.

Rita-Bubnova commented 10 months ago

This issue was closed due no response.