File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -234,8 +234,12 @@ def __repr__(self):
234
234
if self == self .to_integral ():
235
235
return str (self .quantize (decimal .Decimal (1 )))
236
236
else :
237
- # XXX: this adds useless extraneous zeros.
238
- return "%.5f" % self
237
+ # Standard formatting adds useless extraneous zeros.
238
+ o = "%.5f" % self
239
+ # Remove the zeros.
240
+ while o and o [- 1 ] == '0' :
241
+ o = o [:- 1 ]
242
+ return o
239
243
240
244
def as_numeric (self ):
241
245
return float (b_ (repr (self )))
Original file line number Diff line number Diff line change @@ -2731,13 +2731,16 @@ def _readInlineImage(self, stream):
2731
2731
# Check for End Image
2732
2732
tok2 = stream .read (1 )
2733
2733
if tok2 == b_ ("I" ):
2734
- # Sometimes that data will contain EI, so check for the Q operator.
2734
+ # Data can contain EI, so check for the Q operator.
2735
2735
tok3 = stream .read (1 )
2736
2736
info = tok + tok2
2737
+ # We need to find whitespace between EI and Q.
2738
+ has_q_whitespace = False
2737
2739
while tok3 in utils .WHITESPACES :
2740
+ has_q_whitespace = True
2738
2741
info += tok3
2739
2742
tok3 = stream .read (1 )
2740
- if tok3 == b_ ("Q" ):
2743
+ if tok3 == b_ ("Q" ) and has_q_whitespace :
2741
2744
stream .seek (- 1 , 1 )
2742
2745
break
2743
2746
else :
You can’t perform that action at this time.
0 commit comments