Save image files and copy between folders

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

Save image files and copy between folders

Post by Peter@multidesk.se » Fri Mar 03, 2017 1:45 pm

I try to manage images between folders.

I have a photo that I import from a microscope to a predetermined destination folder. I show the picture with "set the filename of the image". And so far so good.
If I am satisfied with the picture, I want to copy the image from its original folder to another predetermined folder of images saved.

How do I do this ?, can anyone come up with some tips on how to save and manage images in folders. and what better way is there to display images than using the path to the image?

Thanks in advance


/// Peter
/*Whats all the fuss with c# ?*/

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Save image files and copy between folders

Post by Klaus » Fri Mar 03, 2017 2:14 pm

Hi Peter,

for copying I always use:

Code: Select all

...
put url("binfile:" & path_to_image_in_predetermined_folder1) into url("binfile:" & path_to_image_in_predetermined_folder2)
...
and what better way is there to display images than using the path to the image?
Define "better"! :D
You could import the image into your stack, but that will take up more memory than referencing the image with "set the filename..."

Code: Select all

...
import paint from file "path_to_image_in_predetermined_folderX"
...
Best

Klaus

Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

Re: Save image files and copy between folders

Post by Peter@multidesk.se » Fri Mar 03, 2017 2:43 pm

OK thanks!

But if I want to save the image into an external db, can I use the file directly, or do I have to import it into my stack first?

/// Peter
/*Whats all the fuss with c# ?*/

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Save image files and copy between folders

Post by Klaus » Fri Mar 03, 2017 3:01 pm

Hi Peter,

ah, yes in that case (image stored in database) there is no filename you can set for an image,
so you have to import it*** like any other result from a database query.

***Or PUT it into an existing image object.


Best

Klaus

Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

Re: Save image files and copy between folders

Post by Peter@multidesk.se » Fri Mar 03, 2017 3:35 pm

Absolutely nothing happens in my target folder when I try to copy my .jpeg file :cry:

Now I have tried:

put the url ("binfile:" & tImagePath) into url ("binfile:" & tFolder).
If I try: get url ("binfile:" & tImagePath) I can see that I have a picture but I can not copy it to the target folder.

Although it is a sub folder to the original destination folder, but that can not play any role in this case, right?

///Peter
/*Whats all the fuss with c# ?*/

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Save image files and copy between folders

Post by Klaus » Fri Mar 03, 2017 3:45 pm

Hi Peter,

1. do not use THE here!
2. You need to provide two valid filenames and not only the target folder (like with "revcopyfile")!

Code: Select all

...
put url("binfile:" & "determinedfolder1/image.jpg") into url("binfile:" & "determinedfolder2/image.jpg")
...
Best

Klaus

Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

Re: Save image files and copy between folders

Post by Peter@multidesk.se » Fri Mar 03, 2017 4:41 pm

Hi Klaus,

Oops! The "the" was a typo on my part when I replyed and nothing I tried out within the code.

Now it works! It was just the small detail of the image file, (as you rightly pointed out,) that needs to be added after the destination folder. Weird! ;-)
I've been staring at this problem for so long that I missed the obvious.

Thousand thanks!

///Peter
/*Whats all the fuss with c# ?*/

Post Reply

Return to “Mac OS”