lib/psd.rb in psd-2.1.2 vs lib/psd.rb in psd-3.1.2
- old
+ new
@@ -1,10 +1,11 @@
-require "bindata"
-require "psd/enginedata"
-require "chunky_png"
+require 'psd/enginedata'
+require 'chunky_png'
+# require "cairo"
-require_relative 'psd/section'
+require 'active_support/core_ext/module/delegation'
+require 'active_support/concern'
dir_root = File.dirname(File.absolute_path(__FILE__)) + '/psd'
[
'/image_exports/*',
'/image_formats/*',
@@ -21,11 +22,10 @@
# the header, resources, the layer mask (including layers), and the preview image. We parse
# each of these sections in order.
class PSD
include Logger
include Helpers
- include NodeExporting
attr_reader :file, :opts
alias :options :opts
# Opens the named file, parses it, and makes it available for reading. Then, closes it after you're finished.
@@ -84,10 +84,12 @@
# Get the Header, parsing it if needed.
def header
return @header if @header
- @header = Header.read(@file)
+ @header = Header.new(@file)
+ @header.parse!
+
PSD.logger.debug @header.inspect
end
# Get the Resources section, parsing if needed.
def resources
\ No newline at end of file