How can I assign a custom icon from a graphic file to another file in Lion? Suppose I have a graphic file (a .png, for instance), and I want to make that graphic the icon for another file or folder. Previously, I would copy the image to the clipboard (either in Preview, like in the instructions in this post or in the Get Info window in the Finder), then open the Get Info window for the target file, select the icon, and paste the image in as the new icon. In the past, this has worked for me.

When I do this in Lion, the result is that the target file now has the default .png icon (document with folded corner, blue-ish image in the middle, and the letters "PNG"), rather than the particular .png image I intended to paste. If the image I am pasting is a .pdf, I get the same results, except that the resulting target file icon has the letters "PDF".

Is there another way that I can assign a custom icon from a graphic file to another file in Lion, because I'm still unable to do it?
When Preview fails, I turn to the Web Browser, master of all filetypes.

Open the image in Safari, Chrome, or Firefox by dragging it to the app's icon or using
File-> Open.

Right click on the image and choose Copy Image (be careful not to use Copy Image URL or Copy Image Location).

From there, use the standard procedure of pasting into the Get Info window.

If the image you want to use is a PDF, you'll need to create a rasterized version that you can copy from the web browser. You can still use Preview for this: open the PDF, choose File-> Export and set the format to PNG. You can open the exported version and copy that.