Save image files and copy between folders

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Save image files and copy between folders

Postby 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
Peter@multidesk.se
 
Posts: 31
Joined: Fri Oct 14, 2011 6:53 am

Re: Save image files and copy between folders

Postby 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
Klaus
 
Posts: 9055
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany

Re: Save image files and copy between folders

Postby 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
Peter@multidesk.se
 
Posts: 31
Joined: Fri Oct 14, 2011 6:53 am

Re: Save image files and copy between folders

Postby 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
Klaus
 
Posts: 9055
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany

Re: Save image files and copy between folders

Postby 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
Peter@multidesk.se
 
Posts: 31
Joined: Fri Oct 14, 2011 6:53 am

Re: Save image files and copy between folders

Postby 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
Klaus
 
Posts: 9055
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany

Re: Save image files and copy between folders

Postby 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
Peter@multidesk.se
 
Posts: 31
Joined: Fri Oct 14, 2011 6:53 am


Return to Mac OS

Who is online

Users browsing this forum: No registered users and 1 guest

cron