Author Topic: bamresizer stuff  (Read 3715 times)

Offline Avenger_teambg

  • Planewalker
  • *****
  • Posts: 399
bamresizer stuff
« on: April 04, 2013, 11:48:57 AM »
Yeah, i know this is old, but i just recently had to use this.
A few things:

1. bamresize.py has a commented out line in its end #main() - uncomment, if you want to run a modified bamresize.py
2. a correct resizeFrame function would be this:

Code: [Select]
    def resizeFrame (self, percent, PILPalette,
                     width, height, data, centerX, centerY):
        im = Image.fromstring("P", (width, height), data)
        im.putpalette(PILPalette)
        if width > 1 and height > 1:
            width = width * percent / 100
            height = height * percent / 100
            im2 = im.resize ((width, height))
            data = im2.tostring()
            centerX = centerX * percent / 100
            centerY = centerY * percent / 100
        return width, height, data, centerX, centerY

Offline Cuv

  • Planewalker
  • *****
  • Posts: 79
Re: bamresizer stuff
« Reply #1 on: April 04, 2013, 11:51:40 AM »
Very nice,  that will be useful!!

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: