# Get the path of the Image in Mathematica

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.

-

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

name = "image.png";
img = Import[name]
FindFile[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.

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