Round print sizes (inches) from width & height in pixels
Posted: Sun Jul 16, 2006 11:24 am
Ok, maybe this is a bit confusing... I can't figure out how to go about this.
Say I have an array of image sizes:
Now I want to figure out a few different sizes that would be printable. For example...
3008x2000 would fit into a 4x6, 8x12, and so on. Up to a 16x24.
4461x4106 wouldn't fit into any thing real well. A 5x5 would work, though. It would end up being 5x4.6, but that's close enough.
Valid sizes are..
4x5,4x6,5x5,5x7,8x8,8x10,8x12,10x10,11x14,10x15,12x12,12x18,16x16,16x20,16x24
Off the top of my head. Might have missed some.
So, in a nutshell:
I need to figure out what sizes are valid for the image dimensions and record it and the actual dimensions it would be. (Ex: 1992x1301 would be 8x12 and 12.249x8)
I really don't know where to start, any help would be appreciated.
Say I have an array of image sizes:
Code: Select all
$sizes = array(
array(2048,1536),
array(1280,768),
array(3008,2000),
array(2764,1396),
array(1301,1992),
array(4296,2608),
array(4461,4106),
);3008x2000 would fit into a 4x6, 8x12, and so on. Up to a 16x24.
4461x4106 wouldn't fit into any thing real well. A 5x5 would work, though. It would end up being 5x4.6, but that's close enough.
Valid sizes are..
4x5,4x6,5x5,5x7,8x8,8x10,8x12,10x10,11x14,10x15,12x12,12x18,16x16,16x20,16x24
Off the top of my head. Might have missed some.
So, in a nutshell:
I need to figure out what sizes are valid for the image dimensions and record it and the actual dimensions it would be. (Ex: 1992x1301 would be 8x12 and 12.249x8)
I really don't know where to start, any help would be appreciated.