Auto Resize Popup Window

I thought this might have already been on here but I can’t find it in a search…

I need to open an image in a pop-up window and have the window resize to the image. Seems simple and I tried a few things but had no luck. I grabbed a script ( which worked fine except it doesn’t work on a Mac and that compatibility is needed for this.

Nevermind - the simpler the better.

I added this code to the popup window itself and it seems to work fine all browsers. Just need to add a little height to accomadate the bottom and not cut off the image.

 window.resizeTo(document.images[0].width + 10,document.images[0].height + 50);