Bug 117454 - Compress dialog: clamp maximum resolution and size to something reasonable (see comment 10)
Summary: Compress dialog: clamp maximum resolution and size to something reasonable (s...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0 all versions
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Image-Compression-Dialog
  Show dependency treegraph
 
Reported: 2018-05-06 06:40 UTC by Emil Tanev
Modified: 2023-11-13 12:45 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Read error screenshot (6.74 KB, image/jpeg)
2020-05-19 18:24 UTC, Bhavesh Patel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emil Tanev 2018-05-06 06:40:08 UTC
Open Writer
Import an image
Write-click the image - Compress
Set Resolution to 969999999
Click Calculate New Size

Issue: Fatal error. Upon clicking OK in the error message, Writer crashes.

https://screencast-o-matic.com/watch/cFh11abTQv


Version: 6.1.0.0.alpha1 (x64)
Build ID: cb47f0d320994e001bc38dc2ee9b7d957b15e6ab
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: en-US (en_US); Calc: group
Comment 1 raal 2018-05-06 07:00:26 UTC
No repro with Version: 6.1.0.0.alpha1+
Build ID: f8f65d88ede1db197c35be7b0db117c321b0d180
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk3;
Comment 2 raal 2018-05-06 07:20:44 UTC
No repro with Version: 6.1.0.0.alpha1+ (x64)
Build ID: e89dc1b6819b3a2d67d2cc077ca7ddee2261998e
CPU threads: 1; OS: Windows 6.1; UI render: default; 

Seems to be fixed with dev version. Please could you test it with
dev version?  You can download it here:
http://dev-builds.libreoffice.org/daily/master/
Comment 3 Emil Tanev 2018-05-07 05:39:27 UTC
Reproducible with 

Version: 6.1.0.0.alpha1+ (x64)
Build ID: 08441d466dd70c203a519a133aaf1a5997adbbd3
CPU threads: 4; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-05-07_01:12:11
Locale: en-US (en_US); Calc: group

https://screencast-o-matic.com/watch/cFhihBbOVl
Comment 4 Julien Nabet 2018-05-07 09:36:24 UTC
On pc Debian x86-64 with master sources updated yesterday, I could reproduce this.
Comment 5 Xisco Faulí 2018-05-08 08:57:17 UTC
Also reproduced in

Versión: 4.4.0.3
Id. de compilación: de093506bcdc5fafd9023ee680b8c60e3e0645d7
Configuración regional: es_ES
Comment 6 Xisco Faulí 2018-05-08 09:01:43 UTC
The Compress Graphic dialog was added in 4.0 by Tomaž Vajngerl -> https://wiki.documentfoundation.org/ReleaseNotes/4.0#GUI

Adding Tomaž to the loop
Comment 7 Julien Nabet 2018-05-09 15:13:41 UTC
With the following patch, we can prevent user from changing the resolution but perhaps it's not what we want:
diff --git a/svx/uiconfig/ui/compressgraphicdialog.ui b/svx/uiconfig/ui/compressgraphicdialog.ui
index 14dd0a1c7bb5..e7539a05368f 100644
--- a/svx/uiconfig/ui/compressgraphicdialog.ui
+++ b/svx/uiconfig/ui/compressgraphicdialog.ui
@@ -419,7 +419,7 @@
                             </items>
                             <child internal-child="entry">
                               <object class="GtkEntry">
-                                <property name="can_focus">True</property>
+                                <property name="can_focus">False</property>
                                 <property name="activates_default">True</property>
                               </object>
                             </child>

Otherwise, perhaps we should consider to define a max resolution?
Comment 8 QA Administrators 2019-05-10 03:07:35 UTC Comment hidden (obsolete)
Comment 9 Bhavesh Patel 2020-05-19 18:24:27 UTC
Created attachment 161012 [details]
Read error screenshot

Version: 6.4.3.2 (x64)
Build ID: 747b5d0ebf89f41c860ec2a39efd7cb15b54f2d8

The program does not crash but on closing the compress dialog, the image placeholder reads "Read Error". Screenshot attached.
Comment 10 Noel Grandin 2020-09-21 13:01:54 UTC
I would suggest 2 things
(a) we clamp maximum resolution to 4000
(b) we also clamp image size to something reasonable. 16k by 16k perhaps.
(the error is most caused by something in the code applying a size limit, not sure where)
Comment 11 QA Administrators 2022-09-22 03:54:53 UTC Comment hidden (obsolete)
Comment 12 Steven Casey 2023-11-13 02:11:50 UTC
Can't repro, calculate size button works and returns "39 KiB (0% reduction)".

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 32; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 13 Buovjaga 2023-11-13 12:45:56 UTC
(In reply to Bhavesh Patel from comment #9)
> Created attachment 161012 [details]
> Read error screenshot
> 
> Version: 6.4.3.2 (x64)
> Build ID: 747b5d0ebf89f41c860ec2a39efd7cb15b54f2d8
> 
> The program does not crash but on closing the compress dialog, the image
> placeholder reads "Read Error". Screenshot attached.

No crash or read error here, but maybe the suggestions from comment 10 should be done anyway.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c0c8cffd3541e3cd616c96791b04e7ebf2b2ed03
CPU threads: 2; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded