Allow a value of 0 in pHYs chunks - #5
Conversation
As far as I can tell that is allowed in the specification
|
This is a bad idea because it can lead to division by zero. For example, if we say that an image has "0 pixels per metre" and the image is 99 pixels wide, then its physical width is (99 pixel) / (0 pixel / metre) = (99 / 0) metre. I can't think of any acceptable use of the value zero here. |
|
Good point, though I could see it being used to indicate only one size is known (but then what if both sizes are 0? what if the unit is unknown?). Or maybe the spec should be updated to explicitly define 0 as unknown? |
As far as I can tell that is allowed in the spec