Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

[MBS] Sending a picture from on OS to another (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] Compile error with Xojo 2013r4.1 and NSTextViewControlMBS.Name
Next thread: [MBS] Subclassing FSEventsMBS


Re: [MBS] Writing to /Library/Preferences in Lion   -   Garth Hjelte
  [MBS] Sending a picture from on OS to another   -   Marnaud
   Re: [MBS] Sending a picture from on OS to another   -   Marnaud
   Re: [MBS] Sending a picture from on OS to another   -   Tim Jones
   Re: [MBS] Sending a picture from on OS to another   -   Christian Schmitz
   Re: [MBS] Sending a picture from on OS to another   -   Marnaud
   Re: [MBS] Sending a picture from on OS to another   -   Christian Schmitz
   Re: [MBS] Sending a picture from on OS to another   -   Marnaud
   Re: [MBS] Sending a picture from on OS to another   -   Tim Jones
   Re: [MBS] Sending a picture from on OS to another   -   Christian Schmitz
   Re: [MBS] Sending a picture from on OS to another   -   Marnaud
   Re: [MBS] Sending a picture from on OS to another   -   Marnaud
   Re: [MBS] Sending a picture from on OS to another   -   Tim Jones
   Re: [MBS] Sending a picture from on OS to another   -   Tim Jones
   Re: [MBS] Sending a picture from on OS to another   -   Marnaud
   Re: [MBS] Sending a picture from on OS to another   -   Christian Schmitz
   Re: [MBS] Sending a picture from on OS to another   -   Marnaud
   Re: [MBS] Sending a picture from on OS to another   -   Marnaud
   Re: [MBS] Sending a picture from on OS to another   -   Christian Schmitz

[MBS] Sending a picture from on OS to another
Date: 23.01.14 18:47 (Thu, 23 Jan 2014 18:47:23 +0100)
From: Marnaud
Hello,

I'm trying to send a picture from one computer to another. My current testing case is from a Mac (10.6) machine to a Linux (ubuntu 10.04) one.

I first tried with PicturetoBinaryStringMBS and BinaryStringtoPictureMBS. BinaryStringtoPictureMBS returned nil.
Then I tried PictureToPNGStringMBS and PNGStringToPictureMBS. The app crashes when it encounters PNGStringToPictureMBS.
Finally I tried PictureToJPEGStringMBS and JPEGStringToPictureMBS which also gave nil.
(so, in all three attempts, the first function runs on the Mac, takes the picture, convert it to a string and send it over TCP/IP. The other function does the reverse on the Linux computer).

I know it's a trivial thing because, natively, every OS has a different format (that's why I tested with PNG and JPEG functions, as I expect them to be compatible between operating systems). Do you think those functions are broken?
(well, I asked a similar question several years ago, but it's out of date; I never got a solution either)
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 24.01.14 16:32 (Fri, 24 Jan 2014 16:32:15 +0100)
From: Marnaud
Le 24 janv. 2014 à 16:28, Tim Jones a écrit:

> This is very odd as I’ve now tried the exact code that I posted using all the way back to MBS 13r2 (the oldest I have) on both clean installs of 32bit and 64bit versions of 10.04 Ubuntu in addition to my live test systems with no crashing.
>
> I’ve also tried 25 different PNG files with complete success.
>
> I hate to add work, but have you tried creating a fresh VM with the 10.04 install and try from there? My Linux systems are pretty convoluted, but maybe there’s something else installed on your system that is conflicting.

Actually, Christian and me are dealing with the problem off-list. We have determined the problem has to do with my installed libraries not matching what the plugin supports. He found a fix.

Thank you for your idea, though, but I think the problem is solved.
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 24.01.14 16:28 (Fri, 24 Jan 2014 08:28:11 -0700)
From: Tim Jones
On Jan 23, 2014, at 4:28 PM, Marnaud <<email address removed>> wrote:

> Le 23 janv. 2014 à 22:43, Christian Schmitz a écrit:
>
>> Sorry, not sure. We do a lot of things here.
>> But we can only fix latest plugin.
>
> Ok, I've downloaded the latest version. Same crash.
> In the example you provided, the crash happens at PictureToPNGStringMBS (so it's not only PNGStringToPictureMBS that crashes on my Linux machine).

This is very odd as I’ve now tried the exact code that I posted using all the way back to MBS 13r2 (the oldest I have) on both clean installs of 32bit and 64bit versions of 10.04 Ubuntu in addition to my live test systems with no crashing.

I’ve also tried 25 different PNG files with complete success.

I hate to add work, but have you tried creating a fresh VM with the 10.04 install and try from there? My Linux systems are pretty convoluted, but maybe there’s something else installed on your system that is conflicting.

Tim

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 24.01.14 09:47 (Fri, 24 Jan 2014 09:47:09 +0100)
From: Christian Schmitz

Am 24.01.2014 um 00:28 schrieb Marnaud <<email address removed>>:

> Ok, I've downloaded the latest version. Same crash.
> In the example you provided, the crash happens at PictureToPNGStringMBS (so it's not only PNGStringToPictureMBS that crashes on my Linux machine).

I will build a version and email you a plugin with debug messages.

Sincerely
Christian

Re: [MBS] Sending a picture from on OS to another
Date: 24.01.14 00:28 (Fri, 24 Jan 2014 00:28:39 +0100)
From: Marnaud
Le 23 janv. 2014 à 22:43, Christian Schmitz a écrit:

> Sorry, not sure. We do a lot of things here.
> But we can only fix latest plugin.

Ok, I've downloaded the latest version. Same crash.
In the example you provided, the crash happens at PictureToPNGStringMBS (so it's not only PNGStringToPictureMBS that crashes on my Linux machine).

>> Where can I look for a crash log of my app to figure out the problem?
>
> not sure where/if ubuntu saves that.

For what it's worth, the app crashes without any warning or such. How should I tell you a bit of the problem if I just get a disappearing app with no backtrace?
Ask whatever test you want me to perform (if I can).
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 22:43 (Thu, 23 Jan 2014 22:43:06 +0100)
From: Christian Schmitz

Am 23.01.2014 um 22:38 schrieb Marnaud <<email address removed>>:

> Ok, your example code crashes for me as well. I have the 13.5 version of your plugin (8th of december 2013); since it will take time to download and install the update, it's worth asking you if you think something has changed since then about this method.

Sorry, not sure. We do a lot of things here.
But we can only fix latest plugin.

> Where can I look for a crash log of my app to figure out the problem?

not sure where/if ubuntu saves that.

Sincerely
Christian

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 22:38 (Thu, 23 Jan 2014 22:38:05 +0100)
From: Marnaud
Le 23 janv. 2014 à 20:46, Christian Schmitz a écrit:

> I tried this with current Xojo and current plugins on Linux and it works here.
>
> Maybe you install newer plugins?
>
> this was my test code:
>
> dim p as Picture = LogoMBS(500)
> dim s as string = PictureToPNGStringMBS(p) //Convert the picture to a PNG string
> dim q as Picture = PNGStringToPictureMBS(s) // then back to a PNG picture.
> Self.Backdrop = q

Ok, your example code crashes for me as well. I have the 13.5 version of your plugin (8th of december 2013); since it will take time to download and install the update, it's worth asking you if you think something has changed since then about this method.

Where can I look for a crash log of my app to figure out the problem?
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 21:21 (Thu, 23 Jan 2014 13:21:25 -0700)
From: Tim Jones
On Jan 23, 2014, at 12:26 PM, Marnaud <<email address removed>> wrote:

> Le 23 janv. 2014 à 20:15, Tim Jones a écrit:
>
>> Arnaud,
>>
>> Try separating that conversion into separate calls:
>>
>> pString = PictureToPNGStringMBS(p) //Convert the picture to a PNG string
>> newp = PNGStringToPictureMBS(pString) // then back to a PNG picture.
>> Self.Backdrop = neap
>
> Well, that's what I already do in the actual application (since one converts to a string and the other app converts back to a PNG).
> Anyway, why do you think separating would solve the problem?

I thought that might be the issue because it worked for me…

> My guess is that's a crash from the plugin.

I think there’s something else going on.

BTW - Ubuntu 10.04, RS 12r2.1 and 13r3.3

Tim

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 20:46 (Thu, 23 Jan 2014 20:46:14 +0100)
From: Christian Schmitz
Hi,

I tried this with current Xojo and current plugins on Linux and it works here.

Maybe you install newer plugins?

this was my test code:

dim p as Picture = LogoMBS(500)
dim s as string = PictureToPNGStringMBS(p) //Convert the picture to a PNG string
dim q as Picture = PNGStringToPictureMBS(s) // then back to a PNG picture.
Self.Backdrop = q

Sincerely
Christian

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 20:27 (Thu, 23 Jan 2014 20:27:07 +0100)
From: Marnaud
Le 23 janv. 2014 à 20:19, Tim Jones a écrit:

> Freaking Apple autocorrect …
>
> That last line should have been:
>
> Self.BackDrop = newp

Yes, I corrected while reading.
Thanks
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 20:26 (Thu, 23 Jan 2014 20:26:41 +0100)
From: Marnaud
Le 23 janv. 2014 à 20:15, Tim Jones a écrit:

> Arnaud,
>
> Try separating that conversion into separate calls:
>
> pString = PictureToPNGStringMBS(p) //Convert the picture to a PNG string
> newp = PNGStringToPictureMBS(pString) // then back to a PNG picture.
> Self.Backdrop = neap

Well, that's what I already do in the actual application (since one converts to a string and the other app converts back to a PNG).
Anyway, why do you think separating would solve the problem?

My guess is that's a crash from the plugin.
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 20:19 (Thu, 23 Jan 2014 12:19:17 -0700)
From: Tim Jones
On Jan 23, 2014, at 12:15 PM, Tim Jones <tolistim@me.com> wrote:

> On Jan 23, 2014, at 12:04 PM, Marnaud <<email address removed>> wrote:
>
>> Here's a sample code that exhibits the problem for me. Can you try it on Linux (mine is Ubuntu 10.04, if you have it)?
>> dim f As FolderItem
>> dim p As Picture
>>
>> f=GetOpenFolderItem("") //Choose a PNG picture (or any other format, BTW)
>> if f<>nil then
>> p=Picture.Open(f) //Works
>> if p<>nil then
>> p=PNGStringToPictureMBS(PictureToPNGStringMBS(p)) //Convert the picture to a PNG string, then back to a PNG picture. Crash here.
>> self.Backdrop=p
>> end if
>> end if
>
> Arnaud,
>
> Try separating that conversion into separate calls:
>
> pString = PictureToPNGStringMBS(p) //Convert the picture to a PNG string
> newp = PNGStringToPictureMBS(pString) // then back to a PNG picture.
> Self.Backdrop = neap
>
Freaking Apple autocorrect …

That last line should have been:

Self.BackDrop = newp

Tim

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 20:15 (Thu, 23 Jan 2014 12:15:56 -0700)
From: Tim Jones
On Jan 23, 2014, at 12:04 PM, Marnaud <<email address removed>> wrote:

> Here's a sample code that exhibits the problem for me. Can you try it on Linux (mine is Ubuntu 10.04, if you have it)?
> dim f As FolderItem
> dim p As Picture
>
> f=GetOpenFolderItem("") //Choose a PNG picture (or any other format, BTW)
> if f<>nil then
> p=Picture.Open(f) //Works
> if p<>nil then
> p=PNGStringToPictureMBS(PictureToPNGStringMBS(p)) //Convert the picture to a PNG string, then back to a PNG picture. Crash here.
> self.Backdrop=p
> end if
> end if

Arnaud,

Try separating that conversion into separate calls:

pString = PictureToPNGStringMBS(p) //Convert the picture to a PNG string
newp = PNGStringToPictureMBS(pString) // then back to a PNG picture.
Self.Backdrop = neap

Tim

_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 20:04 (Thu, 23 Jan 2014 20:04:38 +0100)
From: Marnaud
Le 23 janv. 2014 à 19:44, Christian Schmitz a écrit:

> do the other picture functions for PNG or JPEG work fine?
> Like loading picture from disk?

Well, I can open a PNG picture fine using Picture.Open(f).

> Not that you simply miss a jpeg or png library.

Here's a sample code that exhibits the problem for me. Can you try it on Linux (mine is Ubuntu 10.04, if you have it)?
dim f As FolderItem
dim p As Picture

f=GetOpenFolderItem("") //Choose a PNG picture (or any other format, BTW)
if f<>nil then
p=Picture.Open(f) //Works
if p<>nil then
p=PNGStringToPictureMBS(PictureToPNGStringMBS(p)) //Convert the picture to a PNG string, then back to a PNG picture. Crash here.
self.Backdrop=p
end if
end if
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 19:44 (Thu, 23 Jan 2014 19:44:39 +0100)
From: Christian Schmitz

Am 23.01.2014 um 19:37 schrieb Marnaud <<email address removed>>:

> Yes, thanks, but the code is already done in my app (it works fine from Mac to Mac). It's on Linux that the received data (sent from the Mac) makes a nil picture or crashes the app.
> Your example has no Linux version (I guess you have not tried); I assume it would crash too (I couldn't test and compile, because one of the files in the project is missing).

do the other picture functions for PNG or JPEG work fine?
Like loading picture from disk?

Not that you simply miss a jpeg or png library.

Sincerely
Christian

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 19:40 (Thu, 23 Jan 2014 19:40:39 +0100)
From: Marnaud
Le 23 janv. 2014 à 19:37, Marnaud a écrit:

> …not from Mac to Linux (where I either get nil or a crash).

P.S.: I'm running RS2011r4.3, should it make a difference, with latest (or very close) MBS plugin.
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 19:37 (Thu, 23 Jan 2014 19:37:36 +0100)
From: Marnaud
Le 23 janv. 2014 à 18:55, Christian Schmitz a écrit:

> Of course I have no idea about details of this app, so I can't check it.

I can't share it, because it's very complex. The app sends parameters to another app, including an icon, over a network (similar to your NetworkScreenshot app). Among the sent parameters is an icon (32x32 pixels). It works fine from Mac to Mac but not from Mac to Linux (where I either get nil or a crash).

> Maybe this app gives you an idea:
> http://www.monkeybreadsoftware.de/Software/NetworkScreenshot.shtml
>
> A little bit older, but code is included.

Yes, thanks, but the code is already done in my app (it works fine from Mac to Mac). It's on Linux that the received data (sent from the Mac) makes a nil picture or crashes the app.
Your example has no Linux version (I guess you have not tried); I assume it would crash too (I couldn't test and compile, because one of the files in the project is missing).
Thanks
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] Sending a picture from on OS to another
Date: 23.01.14 18:55 (Thu, 23 Jan 2014 18:55:33 +0100)
From: Christian Schmitz

Am 23.01.2014 um 18:47 schrieb Marnaud <<email address removed>>:

> Hello,
>
> I'm trying to send a picture from one computer to another. My current testing case is from a Mac (10.6) machine to a Linux (ubuntu 10.04) one.
>

I would recommend PNG (no loose).

Of course I have no idea about details of this app, so I can't check it.

Maybe this app gives you an idea:
http://www.monkeybreadsoftware.de/Software/NetworkScreenshot.shtml

A little bit older, but code is included.

Sincerely
Christian