https://bugs.winehq.org/show_bug.cgi?id=8532
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|Abandoned? | Summary|"Invalid imagesize" in |JawsEditor 2.5/3.0 reports |JawsEditor |"Invalid imagesize" on | |startup | |('IPicture::SaveAsFile' | |method too | |stubby/incorrect)
--- Comment #6 from Anastasius Focht focht@gmx.net --- Hello folks,
please state the exact version of the app you reported the bug against. I waste a great deal of my precious time figuring out how to reproduce (it also insults my mind frankly spoken).
Old versions:
http://www.jawspdf.com/download/previous/#editor
Initial bug report: 2007-05-28
JawsPDFEditor2.0.zip -> 2003-11-25 ... JawsPDFEditor.zip (3.0) -> 2006-10-13 JawsPDFEditor.zip (3.5) -> 2008-31-01 ...
Assuming we're talking about 3.0 here.
Revisiting appdb, looking for test results shows this:
https://appdb.winehq.org/objectManager.php?sClass=version&iId=8108
which states "2.5". Actually both seem to exhibit the problem.
--- snip --- $ pwd /home/focht/.wine/drive_c/Program Files/Global Graphics/Jaws PDF Editor 3.0
$ WINEDEBUG=+tid,+seh,+relay,+ole,+variant,+olepicture wine ./PDFEditor.exe
log.txt 2>&1
... 0027:Call oleaut32.OleCreatePictureIndirect(0033f75c,048ebca0,00000001,0033f808) ret=048830a1 0027:trace:olepicture:OleCreatePictureIndirect (0x33f75c,{7bf80981-bf32-101a-8bbb-00aa00300cab},1,0x33f808) 0027:trace:olepicture:OLEPictureImpl_Construct (0x33f75c) type = 1 ... 0027:trace:ole:CreateConnectionPoint (0x202fd0 {9bfbbc02-eff1-101a-84ed-00aa00341d07} 0x20300c) ... 0027:trace:olepicture:OLEPictureImpl_SetBitmap bitmap handle 0x10141 ... 0027:trace:olepicture:OLEPictureImpl_SetBitmap width 22, height 22, bpp 24 ... 0027:trace:olepicture:OLEPictureImpl_Construct returning 0x202fd0 0027:trace:olepicture:OLEPictureImpl_QueryInterface (0x202fd0)->({7bf80981-bf32-101a-8bbb-00aa00300cab}, 0x33f808) 0027:trace:olepicture:OLEPictureImpl_AddRef (0x202fd0)->(ref before=1) 0027:trace:olepicture:OLEPictureImpl_Release (0x202fd0)->(ref before=2) 0027:Ret oleaut32.OleCreatePictureIndirect() retval=00000000 ret=048830a1 ... 0027:Call oleaut32.OleCreatePictureIndirect(0033f75c,048ebca0,00000001,0033f804) ret=048830a1 0027:trace:olepicture:OleCreatePictureIndirect (0x33f75c,{7bf80981-bf32-101a-8bbb-00aa00300cab},1,0x33f804) 0027:trace:olepicture:OLEPictureImpl_Construct (0x33f75c) type = 1 ... 0027:trace:ole:CreateConnectionPoint (0x507be18 {9bfbbc02-eff1-101a-84ed-00aa00341d07} 0x507be54) ... 0027:trace:olepicture:OLEPictureImpl_SetBitmap bitmap handle 0x200fa .... 0027:trace:olepicture:OLEPictureImpl_SetBitmap width 22, height 22, bpp 24 .... 0027:trace:olepicture:OLEPictureImpl_Construct returning 0x507be18 0027:trace:olepicture:OLEPictureImpl_QueryInterface (0x507be18)->({7bf80981-bf32-101a-8bbb-00aa00300cab}, 0x33f804) 0027:trace:olepicture:OLEPictureImpl_AddRef (0x507be18)->(ref before=1) 0027:trace:olepicture:OLEPictureImpl_Release (0x507be18)->(ref before=2) 0027:Ret oleaut32.OleCreatePictureIndirect() retval=00000000 ret=048830a1 0027:trace:olepicture:OLEPictureImpl_QueryInterface (0x507be18)->({7bf80980-bf32-101a-8bbb-00aa00300cab}, 0x33f7bc) 0027:trace:olepicture:OLEPictureImpl_AddRef (0x507be18)->(ref before=1) ... 0027:fixme:olepicture:OLEPictureImpl_SaveAsFile (0x507be18)->(0x9d3420, -1, 0x33f820), hacked stub. 0027:Call user32.LoadStringA(00400000,0000ff63,0033e744,00001000) ret=00406ee3 0027:Ret user32.LoadStringA() retval=00000012 ret=00406ee3 0027:Call KERNEL32.RaiseException(0eedfade,00000001,00000007,0033f734) ret=0045efee 0027:trace:seh:raise_exception code=eedfade flags=1 addr=0x7b846045 ip=7b846045 tid=0027 0027:trace:seh:raise_exception info[0]=0045efee 0027:trace:seh:raise_exception info[1]=009a82a8 0027:trace:seh:raise_exception info[2]=0041bf0c 0027:trace:seh:raise_exception info[3]=0033fd18 0027:trace:seh:raise_exception info[4]=0033fd60 0027:trace:seh:raise_exception info[5]=0033f768 0027:trace:seh:raise_exception info[6]=0033f750 0027:trace:seh:raise_exception eax=7b832ccd ebx=0041bf0c ecx=0000001c edx=0033f694 esi=0033f734 edi=0033f700 0027:trace:seh:raise_exception ebp=0033f6d8 esp=0033f674 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00200287 0027:trace:seh:call_vectored_handlers calling handler at 0x7dfbcbb2 code=eedfade flags=1 0027:trace:seh:call_vectored_handlers handler at 0x7dfbcbb2 returned 0 0027:trace:seh:call_stack_handlers calling handler at 0x45f004 code=eedfade flags=1 ... 0027:Call user32.MessageBoxA(00010092,009d3678 "Invalid image size.",009d3698 "Jaws PDF Editor",00000010) ret=00475b03 --- snip ---
Source: https://source.winehq.org/git/wine.git/blob/2f9987fd043d094c23430a1698f1a722...
--- snip --- 839 static HRESULT WINAPI OLEPictureImpl_SaveAsFile(IPicture *iface, 840 IStream *pstream, 841 BOOL SaveMemCopy, 842 LONG *pcbSize) 843 { 844 OLEPictureImpl *This = impl_from_IPicture(iface); 845 FIXME("(%p)->(%p, %d, %p), hacked stub.\n", This, pstream, SaveMemCopy, pcbSize); 846 return IStream_Write(pstream,This->data,This->datalen,(ULONG*)pcbSize); 847 } --- snip ---
The FIXME here indeed holds true. The app 'Write' method checks 'data' and 'datalen' which are NULL at this point and short-circuits internally by returning HRESULT 0x80030009 -> 'STG_E_INVALIDPOINTER'.
My guess would be one needs to get the picture data from IPicture object which has valid HBITMAP and pass this instead ('GetObject' -> bitmap bits). Kind of what 'OLEPictureImpl_Save' does.
https://source.winehq.org/git/wine.git/blob/2f9987fd043d094c23430a1698f1a722...
--- snip --- 1765 static HRESULT WINAPI OLEPictureImpl_Save( 1766 IPersistStream* iface,IStream*pStm,BOOL fClearDirty) 1767 { 1768 HRESULT hResult = E_NOTIMPL; 1769 void * pIconData; 1770 unsigned int iDataSize; 1771 DWORD header[2]; 1772 ULONG dummy; 1773 BOOL serializeResult = FALSE; 1774 OLEPictureImpl *This = impl_from_IPersistStream(iface); 1775 1776 TRACE("%p %p %d\n", This, pStm, fClearDirty); 1777 1778 switch (This->desc.picType) { ... 1803 case PICTYPE_BITMAP: 1804 if (This->bIsDirty || !This->data) { 1805 switch (This->keepOrigFormat ? This->loadtime_format : BITMAP_FORMAT_BMP) { 1806 case BITMAP_FORMAT_BMP: 1807 serializeResult = serializeBMP(This->desc.u.bmp.hbitmap, &pIconData, &iDataSize); 1808 break; ... 1834 header[0] = (This->loadtime_magic != 0xdeadbeef) ? This->loadtime_magic : 0x0000746c; 1835 header[1] = This->datalen; 1836 IStream_Write(pStm, header, 2 * sizeof(DWORD), &dummy); 1837 IStream_Write(pStm, This->data, This->datalen, &dummy); 1838 hResult = S_OK; 1839 break; --- snip ---
$ sha1sum JawsPDFEditor.zip 5ade136366dc321cb2dc87e717c9961d85c8f52c JawsPDFEditor.zip
$ du -sh JawsPDFEditor.zip 19M JawsPDFEditor.zip
$ wine --version wine-1.7.54
Regards