Get rid of annoying 'missing image' icons in Safari 1.0

Jul 21, '03 08:50:00AM

Contributed by: bluehz

Ever since upgrading to Safari 1.0 I have noticed more and more "missing images" icons showing up on web pages displayed in Safari. This may be because I am also running PithHelmet - but it never occurred with the Safari betas. It occurs many times on items I am not even filtering and should not be missing the images. Anyway - I got sick and tired of pages peppered with the little blue icon indicating a missing image. So I looked around and found the icon and just replaced the image file with a one-pixel blank image. Worked perfectly - no more blue "missing image" icons!

The image you need to replace is located at /System -> Library -> Frameworks -> WebKit.framework -> Versions -> A -> Resources -> missing_image.tiff.

Read the rest of the article for the how-to on replacing the image (the process in short)...

[robg adds: There's a script in the remainder of the article with some wide lines, so consider yourself warned about the width of this hint...]

Here's a summary of what you need to do:

  1. Back up the current icon by copying it to a file named missing_image.tiff-bak in the same directory.
  2. Create a new one-pixel tiff format file, name it missing_image.tiff
  3. Replace the old icon file with new icon file.
  4. Reset permissions (chmod 544) and ownership (chown root.wheel).
Here's a script you can copy/paste and run it and it will backup your original icon and then replace it with a one-pixel icon.

#!/bin/sh
#
# Replaces the blue "missing image" icon in Safari
#

# back up the original image
sudo mv 
/System/Library/Frameworks/WebKit.framework/Versions/A/Resources/missing_image.tiff 
/System/Library/Frameworks/WebKit.framework/Versions/A/Resources/missing_image.tiff-bak

# copy the new image into place
# image should be located in the same dir as this script
# and named EXACTLY "missing_image.tiff"
sudo cp missing_image.tiff /System/Library/Frameworks/WebKit.framework/Versions/A/Resources/

# restore permissions
sudo chown root.wheel /System/Library/Frameworks/WebKit.framework/Versions/A/Resources/missing_image.tiff
sudo chmod 544 /System/Library/Frameworks/WebKit.framework/Versions/A/Resources/missing_image.tiff

# done
echo "The image has been successfully replaced!"
echo "If you ever need to return to the old image"
echo "run the following commands:"
echo " sudo mv /System/Library/Frameworks/WebKit.framework/Versions/A/Resources/missing_image.tiff-bak "
echo " /System/Library/Frameworks/WebKit.framework/Versions/A/Resources/missing_image.tiff"
If you want to download the script and one-pixel icon together - you can get it here.

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030716100210994