Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2022/04/03)Fwd 1 day (to 2022/04/05) >>>20220404 
artifexirc-bot <KenSharp> I'd have to check but I believe it is currently represented by a float, so it's dependent on the math library of the toolchain. The spec simply says that it doesn't **specify** a precision. So best not to rely on small fractions.06:59.10 
  <Robin_Watts> The PDF spec says that Acrobat's implementation uses a float. It doesn't say that anyone else doesn't use more or less.09:13.23 
  <Robin_Watts> So, regardless of what implementation you use you can't assume that '.2f' or similar is enough. (At high numbers, floats can't be guaranteed to represent .2f). But at typical PDF still sizes, sure. .2f is easily representable.09:14.54 
  <KenSharp> FWIW I'll probably be changing it, because of a bug report09:47.19 
  <Robin_Watts> You'll be changing PDFI? From double to float? or vice versa?10:31.16 
  <KenSharp> I haven't really looked into the problem yet, it's more likely to be pdfwrite than pdfi though, I though pdfi already held numbers as double10:31.58 
  <KenSharp> pdfwrite I think holds the Box values as floats10:32.08 
  <KenSharp> So it would be from float to doube anyway10:32.20 
  <Robin_Watts> I thought pdfi already used doubles, and I was vaguely hoping we might be moving it to using floats 🙂10:32.51 
  <KenSharp> I wasn't planning to10:33.14 
  <Robin_Watts> In the grand scheme of things, it's not huge.10:33.37 
  <KenSharp> The bug report (from Alex) is to do with Boxes which are required to nest inside each other, and the precision (and stupidly small differences of course) means they don't. I've not evaluated it at all I don't regard it as in any way urgent10:34.30 
  <velix> @Robin_Watts I've figured out .2f by checking some PDFs from different sources with mutool. And they returned .2f precision. Maybe that's the precision mutool exports by default? :D13:24.09 
  <velix> At least, it can't be integer, since you can't store inch or mm based mediasizes correctly. .2f returns a resonable precision when calculating back to these units.13:25.55 
  <KenSharp> I'm pretty sure the spec ddefines it as a 'number' which means it can be either an integer or a real number13:26.56 
  <KenSharp> Not very many things are defined as integer13:27.07 
  <KenSharp> Hmm apparently its a 'rectangle'....13:28.07 
  <KenSharp> And yes, rectanges are written as an array of four numbers13:28.51 
  <velix> @KenSharp It seems like Qt writes PDFs with intergers only. Whenever I get PDFs created by Qt, they're like [0 0 6500 2131]14:01.40 
  <velix> And this results in wrong MediaFormats.14:01.54 
  <velix> I'll report it there.14:02.31 
  <KenSharp> Yeah can't help you with that 🙂14:02.43 
  <velix> @KenSharp: Yeah, I just was curious, how you intepret the formulation in the PDF ref.14:03.02 
  <KenSharp> There's nothign specifically wrong with an integer Box, but it does limit the precision14:03.03 
  <velix> @KenSharp Sure, but it leads to inexpected results ;)14:03.26 
  <KenSharp> I should think it does if you rely on the canvas being something other than an integer number of points14:03.54 
  <velix> 123.45 mm -> 349.9370078740157 pt. floor(349) vs. ceil(350) -> 123.1194444444444 mm vs. 123.4722222222222 mm14:05.16 
  <KenSharp> Yeah if you stick with integers then your precision is oly to the nearest 1/72 inch. WHich isn't great and is certainly worse if you truncate rather than round.14:06.16 
  <KenSharp> Integers aren't a good choice there14:06.41 
  <velix> Maybe UserUnits can fix this :D14:08.51 
  <KenSharp> Hmm well possibly though that's not really what it's intended for14:09.17 
  <KenSharp> But if you set teh Box 10 times bigger and then set UserUnit to 10 that might do it14:10.03 
  <velix> yeah ;)14:10.39 
  <KenSharp> Actually I'm not sure that would work.....14:11.27 
  <KenSharp> Its getting a bit late in the afternoon to visualise that14:11.41 
  <velix> Please don't even think further on those ugly things.14:11.50 
  <KenSharp> I feel sure that a creative use of UserUnit would have some useful effect, I just can't quite see which way round it should go.14:12.44 
  <velix> @KenSharp: Let it stay on 1.0 ;)14:39.55 
 <<<Back 1 day (to 2022/04/03)Forward 1 day (to 2022/04/05)>>> 
ghostscript.com #mupdf
Search: