lib/psd.rb in psd-0.3.4 vs lib/psd.rb in psd-0.3.5
- old
+ new
@@ -17,17 +17,14 @@
# A general purpose parser for Photoshop files. PSDs are broken up in to 4 logical sections:
# 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
- # Just used to track what layer info keys we didn't parse in this file for development purposes.
- def self.keys; @@keys; end
- @@keys = []
-
DEFAULTS = {
parse_image: false,
parse_layer_images: false
}
@@ -64,20 +61,25 @@
@parsed
end
# Get the Header, parsing it if needed.
def header
- @header ||= Header.read(@file)
+ return @header if @header
+
+ @header = Header.read(@file)
+ PSD.logger.debug @header.inspect
end
# Get the Resources section, parsing if needed.
def resources
return @resources.data unless @resources.nil?
ensure_header
@resources = Resources.new(@file)
@resources.parse
+
+ PSD.logger.debug @resources.inspect
return @resources.data
end
# Get the LayerMask section. Ensures the header and resources
\ No newline at end of file