XOJO 2017r3 Problems From 2015r3.1

Hi
my application no works when i select a picture from a folder it work perfect on 2015r3.1 but no on 2017r3 (32bit or 64bits is same problem)
my file type is image/any

You start debugging with 2017R3 to see what goes wrong. There were quite some versions in between 2015r3.1 and 207r3,

the problems is in my Dev computer works fine but on the customer computer no works
any idea what is

what happens? crash?

what os & version are they using?

That may be the problem if your user try to open (select) a non image file… (and crash if you use drag and drop / drop a Folder into the target in the window).

the application no crash only no upload the picture to the canvas

How do you read the picture to the canvas?

What platform and OS are you and your customer running on… and what type of picture is it?

What does your code look like?

Windows 10
Dim f as FolderItem
f = GetopenFolderItem(“jpg” )
if f <> nil then
EZCanvas21.setPicture Picture.Open(f)
end if
picture type jpeg, png

“The file types must be defined as file types in your project, either in the IDE in a File Type Set or with the FileType class.”

Have you done this?

Also, is your dev OS the same as your customers? (Win10)?

Have you tried running this code on the picture they are using?

Maybe the picture is corrupt?

What is setPicture ? Did you implement this?

What is going on inside there?

You need to give us a bit more information instead of drip feeding things, the more you provide the quicker/easier it is to help.

A simple sample project would be ideal.

And does this method have an exception handler ?
It could have a try/catch around the

EZCanvas21.setPicture Picture.Open(f)

As there is no check here for success or failure when opening the file.
Nor is there a check to see if the file exists, only if the object is nil

Docs:
‘If the FolderItem passed is nil, a NilObjectException is raised. If Picture.Open fails for any other reason, Nil is returned with no other error information.’

So the line will simply pass NIL to EZCanvas21.setPicture
And that may not itself generate an error.

Try something like this:

[code]Dim f as FolderItem
f = GetopenFolderItem(“jpg” ) //better to use filetypes here

if f <> nil then
if f.exists then
dim p as picture
p = Picture.Open(f)
if p = nil then
msgbox “Could not open " + f.nativepath + " as a picture”
else
EZCanvas21.setPicture p
end if
else
msgbox “File does not exist”
end if
end if[/code]

hi
how i can select two type on filetype like jpg,png ony

Create a new filetype.

http://developer.xojo.com/userguide/using-file-type-sets

To combine two file types:

[quote]If your File Type Set has multiple file types, you can concatenate them:

Dim f As FolderItem
f = GetOpenFolderItem(ImageTypes.JPEG + ImageTypes.PNG)[/quote]

This will not resolve your issue if the user is selecting something that has a .jpg filename and yet is not a picture.

I think you insert a File Type Set into your project. Add only the jpeg and png to it, and use:

f = GetOpenFolderItem(ImageTypes.All)

If you have more image types in your ImageTypes definition and only want jpeg and png:

f = GetOpenFolderItem(ImageTypes.JPEG + ImageTypes.PNG)

I hope I’m right.

Edit: Jeff was faster

ok
thanks

how I can select any picture file and no movie files or binary from like iPhone

hi
when i use iphone windows 10 i can copy the picture direct from the iphone i have to copy from iphone to the pc and then copy from the pc to my app

You might want to post this as a new topic in https://forum.xojo.com/conversations/web so it gets the most eyes on it.

When I plug my iPhone into my Windows 10 machine, it appears like an external drive.
I just browse to it and look in the DCIM folder for pictures

What problem are you having?
Are you trying to change the image which exists on the iphone?

And are you writing a web app (Julian’s comment seems odd… is there some other post that has suggested this is a web target??)