Kaydet (Commit) b3f1afc2 authored tarafından Damjan Jovanovic's avatar Damjan Jovanovic Kaydeden (comit) Caolán McNamara

#i124867#: jpg options shows initially wrong estimated file size

File main/svtools/source/filter/exportdialog.cxx

ExportDialog::GetGraphicStream() creates the compressed file from which the
file size is obtained, calling GetFilterData() to obtain the properties used
to save it. GetFilterData() returns image properties, like JPEG colormode
and quality, PNG compression/interlacing/translucence, BMP color and RLE
coding, etc. In the case of JPEG, the quality is read from
maSbCompression.GetThumbPos().

The problem is that in ExportDialog::updateControls(),
maSbCompression.SetThumbPos() is called AFTER GetGraphicStream(), meaning
the stream is created with the old thumb position.

This patches it to call GetGraphicStream() later, immediately before using
that stream, so that its properties such as compression are updated first
and the size is calculated correctly.

Reported by: myspaces at hotmail dot fr
Patch by: me

(cherry picked from commit 48cf17d5)
üst f88f6bcf
...@@ -835,8 +835,6 @@ static OUString ImpValueOfInKB( const sal_Int64& rVal ) ...@@ -835,8 +835,6 @@ static OUString ImpValueOfInKB( const sal_Int64& rVal )
void ExportDialog::updateControls() void ExportDialog::updateControls()
{ {
GetGraphicStream();
// Size Controls // Size Controls
if ( !mbIsPixelFormat ) if ( !mbIsPixelFormat )
{ {
...@@ -886,6 +884,8 @@ void ExportDialog::updateControls() ...@@ -886,6 +884,8 @@ void ExportDialog::updateControls()
if (mpSbCompression && mpSbCompression->IsVisible() && mpNfCompression) if (mpSbCompression && mpSbCompression->IsVisible() && mpNfCompression)
mpSbCompression->SetThumbPos(mpNfCompression->GetValue()); mpSbCompression->SetThumbPos(mpNfCompression->GetValue());
GetGraphicStream();
// updating estimated size // updating estimated size
sal_Int64 nRealFileSize( mpTempStream->Tell() ); sal_Int64 nRealFileSize( mpTempStream->Tell() );
if ( mbIsPixelFormat ) if ( mbIsPixelFormat )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment