Re: [Bug 26526] Fix aspect ratio constraint

On 9/11/14 3:22 PM, cowwoc wrote:
> Here is my use-case: I've got this 4x3 section in my UI for video. 
> Now, I want the highest resolution video you can give me with this 
> aspect ratio. If you return some low-res video I will up-scale it to 
> fit. Meaning, 800x1200 or 400x600 are fine but 788x1200 is not because 
> it will look bad to have a column of 12 black pixels alongside the 
> video (I'm aiming for no black bars or cropping). If I really have to 
> (the webcam doesn't support the desired resolution) I'll crop the 
> video, but I don't like you making me crop the video when I don't have 
> to (rounding error caused by the epsilon value).
>
> I hope this clears it up.

Thanks, that helps! - First, I note that your example doesn't seem to be 
a problem with Harald's value, so there's that.

Being precise surely helps, though realistically, what camera has two 
resolutions within the margin of error of a two- (or for Harald's value 
three)-digit aspect-ratio?

But let me assume there is one...

I may be wrong on this, but if we *did* decide on just two decimals of 
precision on inputs, then rather than round everything on input - which 
might cause error-accumulation - I'd assumed we'd instead round 
non-destructively inside some comparison function used by min, max and 
exact. That way it seems possible to me that ideal's distance algorithm 
could still work reliably enough to give 800x1200 a smaller distance 
than 788x1200, provided an { ideal: 4/6 }. Epsilon is perhaps not the 
best word for this, and I may not be making any sense, and it sounds a 
bit complicated.

.: Jan-Ivar :.

Received on Thursday, 11 September 2014 20:39:00 UTC