Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

When copying the Image from the hard drive to the Mathematica notebook, what can I do to have the path of the Image?

I tried Imort[img] // Path where img is Image but it didn't work.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You can use the name to find the path, but not the image variable.

name = "image.png";
img = Import[name]

FindFile finds the same file that Import finds. If you have another image with the same name in a different directory, by changing to that directory (with SetDirectory) Import and FindFile will find the second image.

share|improve this answer
I don't know the name, I just drag and drop the image to the notebook. –  SuTron Jan 18 at 12:59
Then you have copied the image and the path information has gone. –  Chris Degnen Jan 18 at 13:06
So not to loose the path info, I need to import it not to copy? –  SuTron Jan 18 at 13:08
Yes, that's the usual way. –  Chris Degnen Jan 18 at 13:15
In that case what is the point to use FindFile, if you know the name? –  SuTron Jan 18 at 13:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.