docsplit 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/docsplit.gemspec +2 -2
- data/lib/docsplit.rb +1 -1
- data/lib/docsplit/image_extractor.rb +2 -1
- metadata +2 -2
data/docsplit.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'docsplit'
|
3
|
-
s.version = '0.1.
|
4
|
-
s.date = '
|
3
|
+
s.version = '0.1.2' # Keep version in sync with jammit.rb
|
4
|
+
s.date = '2010-3-19'
|
5
5
|
|
6
6
|
s.homepage = "http://documentcloud.github.com/docsplit/"
|
7
7
|
s.summary = "Break Apart Documents into Images, Text, Pages and PDFs"
|
data/lib/docsplit.rb
CHANGED
@@ -5,6 +5,7 @@ module Docsplit
|
|
5
5
|
class ImageExtractor
|
6
6
|
|
7
7
|
DENSITY_ARG = "-density 150"
|
8
|
+
MEMORY_ARGS = "-limit memory 128MiB -limit map 256MiB"
|
8
9
|
DEFAULT_FORMAT = :png
|
9
10
|
|
10
11
|
# Extract a list of PDFs as rasterized page images, according to the
|
@@ -22,7 +23,7 @@ module Docsplit
|
|
22
23
|
directory = File.join(@output, subfolder)
|
23
24
|
FileUtils.mkdir_p(directory) unless File.exists?(directory)
|
24
25
|
out_file = File.join(directory, "#{basename}_%05d.#{format}")
|
25
|
-
cmd = "gm convert +adjoin #{DENSITY_ARG} #{resize_arg(size)} #{quality_arg(format)} \"#{pdf}#{pages_arg}\" \"#{out_file}\" 2>&1"
|
26
|
+
cmd = "gm convert +adjoin #{MEMORY_ARGS} #{DENSITY_ARG} #{resize_arg(size)} #{quality_arg(format)} \"#{pdf}#{pages_arg}\" \"#{out_file}\" 2>&1"
|
26
27
|
result = `#{cmd}`.chomp
|
27
28
|
raise ExtractionFailed, result if $? != 0
|
28
29
|
renumber_images(out_file, format)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docsplit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Ashkenas
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-03-19 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|