Issue304

Title Make Croppy more format-flexible
Priority bug Status resolved
Assigned To Keywords
Linked issues Watchers

Submitted on 2011-07-24 19h07 by tracker_migration, last changed by joseph.

Messages
Author: tracker_migration Date: 2010-09-27   17h44
Submitted by lowerthanred
Currently, croppy will only accept (i.e. crop and generate offset for) images of PNG, 200x240 or 400x480 format.

This is quite limiting: for instance, making a death animation requires making sure every part of the character is in frame, meaning that the character can't fall too far backwards and in some characters this means having to actually shrink some parts (like mrs. stone's hair or the cook's hat). Even then, some bits are often left out of the frame.
This is also limiting when making tux images of long weapons that can go outside the frame, like the energy whip.
Furthermore, if we ever want to make something that's larger than 400x480 (really large machines or huge bosses), croppy won't enable us.

I would like croppy to accept a wider variety of image sizes to avoid these limitations.
Author: tracker_migration Date: 2010-09-27   18h04
Posted by matthiaskrgr
on ll. 571 of croppy.c it says

if ((input_surface->w == 400) && (input_surface->h == 480)) {
*default_center_x = 199;
*default_center_y = 381;
DebugPrintf(1, "\nCROPPY: Image size 400x480 (typical larger tux part rendering).  Using %d/%d default origin.",
*default_center_x, *default_center_y);
return TRUE;
Author: tracker_migration Date: 2010-09-27   18h06
Posted by matthiaskrgr
grr  pressed enter to early
looking at the code

if ((input_surface->w == 400) && (input_surface->h == 480)) {
*default_center_x = 199;
*default_center_y = 381;
DebugPrintf(1, "\nCROPPY: Image size 400x480 (typical larger tux part rendering).  Using %d/%d default origin.",
*default_center_x, *default_center_y);
return TRUE;
}

You might be able to just modify the numbers to get the resolution you need.
I didn't try it yet and I also have no knowledge about that croppy thing.
I just was curious, so I took a look inside... :)
Author: tracker_migration Date: 2010-09-27   20h36
Posted by lowerthanred
Hmm. Croppy does accept other sizes. Squares of 60, 64, 80, 100, 120 and 128. Oops. :P
However, the maximum size does seem to be 400x480. which still limits us.

Also, I'd like to know if the default_center of all the sizes is calculated the same way; we should document this and try to find an easy way to avoid offset issues.
Author: tracker_migration Date: 2010-09-27   20h44
Posted by matthiaskrgr
Btw, which size do you need? I could *try* to make a patch.
Author: tracker_migration Date: 2011-03-21   11h01
Posted by ahuillet
I think we need to be wary of big objects. 400x480 seems pretty big already, and represents 400 *480 * 4  = 750kB of texture memory.

However, I don't quite see why there is any limit on either the size or the aspect ratio. What croppy does (I wrote "crappy" :p) should not required fixed sizes.
Author: matthiaskrgr Date: 2011-07-27   12h50
Is this still an issue?
Author: joseph Date: 2011-07-27   13h04
Croppy accepts images of any size now, so it shouldn't be an issue now.
History
Date User Action Args
2011-07-27 13:04:45josephsetstatus: open -> resolved
messages: + msg1343
2011-07-27 12:50:55matthiaskrgrsetmessages: + msg1342
2011-07-24 19:07:57tracker_migrationcreate