#!/usr/bin/env python

from gimpfu import *

def python_center_layer(image, layer):
    x = (image.width - layer.width) / 2
    y = (image.height - layer.height) / 2
    layer.set_offsets(x, y)

register(
        "python_fu_center_layer",
        "Center a layer on the image",
        "Center a layer on the image",
        "Manish Singh",
        "Manish Singh",
        "2004",
        "<Image>/Python-Fu/Center Layer",
        "",
        [],
        [],
        python_center_layer)

main()
