macos 64bits debug works, but not the compiled app ?

Hi everyone,

how can this be possible ? the debug app works fine, but the compiled app runs, no error, but does not the job wanted (blank page)
I ported the rbfpdf app from here to xojo 2017r3
https://github.com/roblthegreat/rsfpdf

the 32b debug works ok, as the 32b compiled app also works ok.

thanks.

Does it misbehave on all platforms or just one of them?

Those tests fail the same way in 32-bit for me.

I had to change some integers to uint8, uint16, don’t remember which ones
the fact is the app I’ve got now is fully working (all examples) in 32b debug or compiled
and works in 64b debug, but outputs blank pages in 64b compiled.

what I don’t understand is why does it work in 64b debug, and not same behavior in 64b compiled ?
how is this even possible ?

here is my version of rbfpdf:
https://drive.google.com/open?id=1cm8K_pSDfwYU01B6_YGOdYdzyfluXghU

I just tried on macos (10.11.6). did not bother to launch virtual machines …

after examining, the generated pdf in the 64b version does not insert the gzipped streams of the pdf. so the blank page.
so it seems the 64b does not recognize the 64b zlib ?
so it could be that the 64b debug uses the 32b zlib ( as it doesn’t find a 64b one) and it should not use it ?

after examining, the generated pdf in the 64b version does not insert the gzipped streams of the pdf. so the blank page.
so it seems the 64b does not recognize the 64b zlib ?
so it could be that the 64b debug uses the 32b zlib ( as it doesn’t find a 64b one) and it should not use it ?

I doubt it. It’s more likely that the zlib compression is disabled on debug runs.

no, in the stream markers of the pdf files, the 64b debug outputs some datas
but the 64b compiled outputs zero length datas.
so the zlib is disabled on compiled apps ?

I compared the files of example1 from debug or compile version.

ok, so here’s one problem…
in the parsePNG method, ~ line 17 it says:

if( t.Read(8) <>  chr(137) + "PNG" + chr(13) + chr(10) + chr(26) + chr(10)) then

when it should be:

if( t.Read(8) <>  chrb(137) + "PNG" + chrb(13) + chrb(10) + chrb(26) + chrb(10)) then

That should fix Test 2 (in debug mode anyway)

As far as why it crashes, what I’m seeing is a NilObjectException when running the built app. In the case of Test 2, the reason for that is how you are calculating the path to the image.

If you go to the Shared Settings and change the Debug Destination to your desktop, you’ll see that the NilObjectException happens on the line that says:

logopath = GetFolderItem("").Child("demoinfo").Child("logo_rpdf.png").ShellPath

Something else to consider… In fpdf.Image the extension detection code assumes that the only period in the path will be the one before the file extension. You should probably change that section to use something like this:

//First use of image, get info if(type = "") then type = NthField(file,".",CountFields(file,".")) end if

Here, try this one instead…

https://www.dropbox.com/s/pgg2my7l3cmgcqy/rspdf.zip?dl=1

there is still a problem with all the examples, the debug run is ok, but the compiled app gives a white pdf page for each example …
they all work if you are in 32bit mode.

Well on the project I posted they all work in 64-bit here.

sorry Greg, I have the same error with your project : blank pages on 64 bits compiled app, but ok with debug in 64 bits
does anyone else have this same issue ?
what can it come from ?

MacOS 10.12.6 Greg’s example run ok in debug 32 bit and 64 bit.
Blank PDF with example 1, 3 and 4, exception with example 2 and 5 if I build the app 64 bit and then run it.
Good PDF with example 1, 3 and 4, exception with example 2 and 5 if I build the app 32 bit and then run it.

nice to see I’m not alone :wink:

I think the exception is because the demoinfo folder is not copied when the app is built.

I saw this on Build Settings - CopyFiles1:
This file could not be found - …/…/demoinfo/

I dragged the demoinfo folder and now I don’t get the exceptions. Still blank pages with 64 bit and good PDFs with 32 bit build apps.

yes it is the demofolder. same result as I have so.
still a problem as we have a different behavior between debug and compile apps in 64bits mode only.
and we have a test project !

let’s wait for Greg to wake up …