Not sure if a script like this exists.
It may be useful in some cases.
Fits all layers (or 'only visible' layers) to image size.
Install script in your scripts directory
(you can see the scripts directory by going to
Edit -> Preferences
and then once the preferences windows opens,
go to Folders -> Scripts)
How to test:
* Create a new image (say: 800x600px)
* Create another, but smaller image (say 100x100px)
* Copy the small image (Ctrl+C)
* Paste in the bigger image (and create a new layer)
* Duplicate this new layer a couple of times
Here are some scripts from my scripts directory, which happened to be fixed for 2.8, either because I needed them or out of curiosity. They may be backward incompatible with 2.6. If I did the work before the authors, they can receive their good back here. I updated this package on 2012/09/09, adding some other great scripts I use daily.
Cuts out 4 standard pictures from a scanned image.
The use case is that you use your scanner to scan in standard photos 4 at a time, you would like to split this scanned image and save it as 4 separate files to continue work with the image processing software on. But rather than to open each image and select every single picture in the image scan this batch script is cutting out 4 photos for you.
The 4 pictures will have the same filename as the original file and added a suffix of _1, _2, _3 and _4