On my current project I'm using FeedAPI to turn RSS items into nodes. Many of these feed items include photos; but in some instances the photos are too big for my layout.

What I'm trying to do is come up with some sort of string replacement to make the photos smaller - e.g., set all their widths to some standardized amount (like width="240") and then change the height to blank so that they scale properly.

Even though there is a width and height attribute in all these image tags, I don't know what the width is going to be ahead of time; so some sort of wildcard would be needed for the replace code. It seems to me that I need a PHP snippet to do this; and I don't know how this would be done, or where I would put it for this to work. Anyone have any ideas? My thanks in advance --