Bug 95680 - Convert - Metafile - Save Image... No function. Must use Alt+R
Summary: Convert - Metafile - Save Image... No function. Must use Alt+R
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0 target:24.8.3
Keywords: bibisected, regression
Depends on:
Blocks: Draw-Images
  Show dependency treegraph
 
Reported: 2015-11-08 17:40 UTC by geir.granberg
Modified: 2024-10-26 01:13 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description geir.granberg 2015-11-08 17:40:00 UTC
On a drawing object when choosing Convert - To Metafile
and then rightclick and choose Save Image... (Maybe the text to use is: Save as Picture...)
Nothing happens, must use Alt+R for saving the Metafile.
Comment 1 MM 2015-11-08 19:35:12 UTC
Unconfirmed with v3.3.4 under windows 7 x64.
Confirmed with v4.1.6.2 under mint 16 x64.
Confirmed with v5.0.3.2 under mint 17.2 x64.

Not only can't you save the object, you also can't compress it.
After copy/paste special > 'gdi metafile'/'drawing format', saving with writer works, but not with impress (still no option in calc to save).
Comment 2 Xisco Faulí 2016-09-12 12:17:19 UTC Comment hidden (obsolete)
Comment 3 Xisco Faulí 2016-10-06 12:03:06 UTC Comment hidden (obsolete)
Comment 4 Aron Budea 2017-02-03 10:20:08 UTC
Already there in 4.0.0.3 / Ubuntu 16.04.
Dialog pops up as expected in 3.6.0.4.
Comment 5 QA Administrators 2018-02-04 03:30:29 UTC Comment hidden (obsolete)
Comment 6 Goyo 2018-05-08 09:04:36 UTC
Still present in 6.0.3

Detailed steps since the original description looks a bit imprecise to me:

1. Create a Draw document
2. Insert > Image, select an image, click Open.
3. Right click on the image, Save works at this point.
4. Right click on the image, Convert > To Metafile.
5. Right click on the image again, Save no longer works (does nothing).

The bug affects also Impress and probably other applications.


Version: 6.0.3.2
Build ID: 8f48d515416608e3a835360314dac7e47fd0b821
CPU threads: 4; OS: Windows 6.1; UI render: default; 
Locale: en-US (es_ES); Calc: group
Comment 7 Buovjaga 2018-06-30 18:37:21 UTC
Bibisected with Linux 43all to range https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=fdda178d888127c4b4dafd4b53800989929e9b6b...6b11a18071254a443c8fe7e7b0b1c95b0f9fd35e

These commits pop out to me: https://cgit.freedesktop.org/libreoffice/core/commit/?id=982db7bc6b82185202fb1a31ab29398b68c75073
Move "save graphic" dialog title to svx.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=8c1aafe8c20b6de8e13b4ce0eb34bb1b1f04fc0f
Change "Save graphic" and "Save picture as" to common code.

Adding Cc: to Tomaž Vajngerl
Comment 8 QA Administrators 2019-08-19 06:58:32 UTC Comment hidden (obsolete)
Comment 9 Goyo 2019-09-17 19:37:16 UTC
Confirmed in LO 6.3.1.2.
Comment 10 Xisco Faulí 2020-07-10 09:00:21 UTC
Hi Julien,
Is this issue fixed after bug 60684 ?
Comment 11 Julien Nabet 2020-07-10 09:16:07 UTC
(In reply to Xisco Faulí from comment #10)
> Hi Julien,
> Is this issue fixed after bug 60684 ?

I gave a try, no it's not fixed after tdf#60684
Comment 12 Julien Nabet 2020-07-10 09:30:22 UTC
https://opengrok.libreoffice.org/xref/core/sd/source/ui/view/drviews2.cxx?r=12bbcce5#1383

when it works, we got:
#0  XOutBitmap::WriteGraphic(Graphic const&, rtl::OUString&, rtl::OUString const&, XOutFlags, Size const*, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const*)
    (rGraphic=..., rFileName="file:///tmp/testjul.jpg", rFilterName="jpg", nFlags=(XOutFlags::DontAddExtension | XOutFlags::DontExpandFilename | XOutFlags::UseNativeIfPossible), pMtfSize_100TH_MM=0x0, pFilterData=0x7ffffffe8c98) at svx/source/xoutdev/_xoutbmp.cxx:193
#1  0x00007ffff251eb30 in GraphicHelper::ExportGraphic(weld::Window*, Graphic const&, rtl::OUString const&) (pParent=0x40411e0, rGraphic=..., rGraphicName="") at svx/source/core/graphichelper.cxx:318
#2  0x00007fffde98ad20 in sd::DrawViewShell::FuTemporary(SfxRequest&) (this=0x34a1540, rReq=...) at sd/source/ui/view/drviews2.cxx:1407

the save is done if this following if is ok:
   1383                 if (pObj && pObj->GetGraphicType() == GraphicType::Bitmap)
   1384                 {
   1385                     weld::Window* pFrame = GetFrameWeld();
   1386                     GraphicAttr aGraphicAttr = pObj->GetGraphicAttr();

Once it's converted to metafile, since pObj->GetGraphicType() = GraphicType::GdiMetafile we don't enter the if block and so nothing happens.

If you reconvert to bitmap again, save works.

Tomaž: any thoughts here? Should an error popup appear to indicate we can't save 
the file in metafile? Or should Save option work but should only propose EMF or other metafile formats?
Comment 13 Tomaz Vajngerl 2020-07-24 07:40:07 UTC
(In reply to Julien Nabet from comment #12)
> Tomaž: any thoughts here? Should an error popup appear to indicate we can't
> save 
> the file in metafile? Or should Save option work but should only propose EMF
> or other metafile formats?

What's the scenario?
Comment 14 Julien Nabet 2020-07-24 07:50:51 UTC
(In reply to Tomaz Vajngerl from comment #13)
> (In reply to Julien Nabet from comment #12)
> > Tomaž: any thoughts here? Should an error popup appear to indicate we can't
> > save 
> > the file in metafile? Or should Save option work but should only propose EMF
> > or other metafile formats?
> 
> What's the scenario?

See https://bugs.documentfoundation.org/show_bug.cgi?id=95680#c6
"
1. Create a Draw document
2. Insert > Image, select an image, click Open.
3. Right click on the image, Save works at this point.
4. Right click on the image, Convert > To Metafile.
5. Right click on the image again, Save no longer works (does nothing).
"
Comment 15 Tomaz Vajngerl 2020-07-24 13:37:57 UTC
If it converted to a Metafile - you can save it as a SVM - "StarView Metafile".
Comment 16 Julien Nabet 2020-07-24 15:32:06 UTC
(In reply to Tomaz Vajngerl from comment #15)
> If it converted to a Metafile - you can save it as a SVM - "StarView
> Metafile".

No, if the image has been converted to metafile, when using Save from right click, there's not even a dialog box allowing to choose the file format.
You can only convert the image into bitmap again and Save will work again.
Comment 17 Tomaz Vajngerl 2020-07-24 18:00:24 UTC
That's how it is now - I'm talking what it should happen.
Comment 18 Julien Nabet 2020-07-24 21:02:07 UTC
(In reply to Tomaz Vajngerl from comment #17)
> That's how it is now - I'm talking what it should happen.

I suppose it should propose to save too, ideally by proposing only meta file formats.
Comment 19 QA Administrators 2022-07-25 03:27:49 UTC Comment hidden (obsolete)
Comment 20 Goyo 2022-08-16 08:42:19 UTC
Still present in LO 7.3.5

Version: 7.3.5.2 (x64) / LibreOffice Community
Build ID: 184fe81b8c8c30d8b5082578aee2fed2ea847c01
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-IE (es_ES); UI: en-US
Calc: threaded
Comment 21 Noel Grandin 2024-10-25 08:17:13 UTC
The obvious fix seems to work here, although it could be improved by auto-selecting metafile format as output.

https://gerrit.libreoffice.org/c/core/+/175624
Comment 22 Commit Notification 2024-10-25 12:28:45 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d8805b6fa554f8a7b720c79599cff5d88ddccd05

tdf#95680 Convert - Metafile - Save Image... No function.

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 23 Commit Notification 2024-10-26 01:13:22 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/7b7ee2adaf608cd9a5ba544c83acd1d0d775c77b

tdf#95680 Convert - Metafile - Save Image... No function.

It will be available in 24.8.3.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.