Do you want to: Report a bug
Steps to reproduce. Create empty document. Copy image from browser (chrome and firefox tested), paste to OnlyOffice Document. Attached screenshot what happens after pasting image.
Document Server version: not using, standalone client
OS: Windows 10 Home x64, last updated
Additional information:
Last updated client. Tried to reopen existing document in odt and docx formats. Nothing helps.
However if I paste image with LibreOffice and save it. Then open same document with OnlyOffice and I see my image. But pasting new images still not working.
Hello,
Please clarify, what is the version of ONLYOFFICE Desktop Editors being used?
Also, please provide a screen recording of the issue reproduction. The issue wasn’t reproduced on the last 8.1.1 version when the image was copied from Chrome browser and pasted into the app
Hi. Sure, version is 8.1.1.27 (x64 exe).
Here is screencast: https://youtu.be/RGB06jK3Y5I
Also here is link to page with image: link to page with image
In fact it could be any item from ozon retail. Also I found pasting from some other web sites (like gMail) works fine. Don’t know what so special about ozon. But as you see from video, it can be pasted to paint. And to LibreOffice too (not installed on this PC, sorry).
Thank you for fast response.
Thank you for sharing, we are currently analysing the issue
Hello, we have registered a relevant bug in our bug tracking system. Thank you for sharing and sorry for the inconvenience
I have same issue, when I get iamges and inser it from a macro.
The images are being inserted but if I reopen the app it doesn’t work.
https://www.loom.com/share/c4c1fa453cd94171a2c3ca5b018d63be?sid=0f7ae1ec-18eb-43fb-952a-0309c7f423db
Macro code
(async function() {
alert("Hello");
// 1. Get the main document object
const doc = Api.GetDocument();
// 2. Define styles and constants
const numberOfImages = 5;
// 1 inch = 914,400 EMUs. Let's set a fixed width of 4 inches.
const fixedWidthEmu = 4 * 914400;
// 3. Add a styled title
let titlePara = doc.GetElement(0) || Api.CreateParagraph();
// Clear the first paragraph if it has content, or create a new one
if (doc.GetElement(0)) {
titlePara.RemoveAllElements();
}
titlePara.AddText(`Macro: Inserting ${numberOfImages} Scaled Images from an API`).SetBold(true).SetFontSize(16);
if (!doc.GetElement(0)) {
doc.Push(titlePara);
}
// Add a blank line for spacing
doc.Push(Api.CreateParagraph());
try {
// 4. Fetch a list of images from the Lorem Picsum API
const response = await fetch(`https://picsum.photos/v2/list?limit=${numberOfImages}`);
if (!response.ok) {
throw new Error(`API request failed with status ${response.status}`);
}
const imageList = await response.json();
// 5. Loop through the image list and insert each one
for (const imageInfo of imageList) {
// Calculate the correct height to maintain aspect ratio
const originalWidth = imageInfo.width;
const originalHeight = imageInfo.height;
const aspectRatio = originalHeight / originalWidth;
const scaledHeightEmu = Math.round(fixedWidthEmu * aspectRatio);
// Create a paragraph for the image and center it
let imagePara = Api.CreateParagraph();
imagePara.GetParaPr().SetJc("center"); // Justification: Center
// Create the ApiImage object with calculated dimensions
const oImage = Api.CreateImage(imageInfo.download_url, fixedWidthEmu, scaledHeightEmu);
// Add the image to the paragraph using AddDrawing, as per the documentation
imagePara.AddDrawing(oImage);
doc.Push(imagePara);
// Create a styled caption paragraph
let captionPara = Api.CreateParagraph();
captionPara.GetParaPr().SetJc("center");
captionPara.GetParaPr().SetSpacingAfter(240); // Add space after the caption
let run = captionPara.AddText(`Image by: ${imageInfo.author}`);
let textPr = run.GetTextPr();
textPr.SetItalic(true);
textPr.SetFontSize(10);
textPr.SetColor(128, 128, 128); // Grey color
doc.Push(captionPara);
}
} catch (error) {
// 6. Handle any errors
let errorPara = Api.CreateParagraph();
let errorRun = errorPara.AddText("Error: " + error.message);
errorRun.GetTextPr().SetBold(true).SetColor(255, 0, 0); // Red color
doc.Push(errorPara);
}
})();
Hello, sorry for the delayed response, although the above-described deals with image insertion as well, it seems to be related to a different issue, it is a different insertion scenario, please create a new thread for this particular case