lib/prawn/images.rb in prawn-0.14.0 vs lib/prawn/images.rb in prawn-0.15.0
- old
+ new
@@ -9,10 +9,12 @@
require 'pathname'
module Prawn
module Images
+ # @group Stable API
+
# Add the image at filename to the current page. Currently only
# JPG and PNG files are supported. (Note that processing PNG
# images with alpha channels can be processor and memory intensive.)
#
# Arguments:
@@ -66,13 +68,15 @@
embed_image(pdf_obj, info, options)
info
end
+
# Builds an info object (Prawn::Images::*) and a PDF reference representing
# the given image. Return a pair: [pdf_obj, info].
#
+ # @private
def build_image_object(file)
io = verify_and_open_image(file)
image_content = io.read
image_sha1 = Digest::SHA1.hexdigest(image_content)
@@ -98,9 +102,10 @@
# Given a PDF image resource <tt>pdf_obj</tt> that has been added to the
# page's resources and an <tt>info</tt> object (the pair returned from
# build_image_object), embed the image according to the <tt>options</tt>
# given.
#
+ # @private
def embed_image(pdf_obj, info, options)
# find where the image will be placed and how big it will be
w,h = info.calc_image_dimensions(options)
if options[:at]