Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/preflight/measurements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ module Measurements
# convert inches to standard PDF points
#
def in2pt(inch)
return inch * BigDecimal.new("72")
return inch * BigDecimal('72')
end

# convert mm to standard PDF points
#
def mm2pt(mm)
return mm * (BigDecimal.new("72") / BigDecimal.new("25.4"))
return mm * (BigDecimal('72') / BigDecimal('25.4'))
end

# convert mm to standard PDF points
Expand Down
2 changes: 1 addition & 1 deletion lib/preflight/rules/consistent_boxes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ConsistentBoxes

# Default tolerance is that each page box MUST be within .03 PDF points
# of the same box on all other pages
DEFAULT_TOLERANCE = (BigDecimal.new("-0.03")..BigDecimal.new("0.03"))
DEFAULT_TOLERANCE = (BigDecimal('-0.03')..BigDecimal('0.03'))

attr_reader :issues

Expand Down
2 changes: 1 addition & 1 deletion lib/preflight/rules/cropbox_matches_mediabox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def page=(page)
private

def round_off(*arr)
arr.flatten.compact.map { |n| BigDecimal.new(n.to_s).round(2) }
arr.flatten.compact.map { |n| BigDecimal(n.to_s).round(2) }
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/preflight/rules/mediabox_at_origin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def page=(page)
private

def round_off(*arr)
arr.flatten.compact.map { |n| BigDecimal.new(n.to_s).round(2) }
arr.flatten.compact.map { |n| BigDecimal(n.to_s).round(2) }
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/preflight/rules/min_ppi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def invoke_image_xobject(xobject)
device_w = pt2in(image_width)
device_h = pt2in(image_height)

horizontal_ppi = BigDecimal.new((sample_w / device_w).to_s).round(3)
vertical_ppi = BigDecimal.new((sample_h / device_h).to_s).round(3)
horizontal_ppi = BigDecimal((sample_w / device_w).to_s).round(3)
vertical_ppi = BigDecimal((sample_h / device_h).to_s).round(3)

if horizontal_ppi < @min_ppi || vertical_ppi < @min_ppi
@issues << Issue.new("Image with low PPI/DPI", self, :page => @page.number,
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/consistent_boxes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

it "pass files with mismatched MediaBox on each page within the defined tolerance" do
filename = pdf_spec_file("two_mismatched_pages")
tolerance = (BigDecimal.new("-300")..BigDecimal.new("300"))
tolerance = (BigDecimal("-300")..BigDecimal("300"))
rule = Preflight::Rules::ConsistentBoxes.new(tolerance)

PDF::Reader.open(filename) do |reader|
Expand Down