imgkit 0.9.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +9 -5
- data/VERSION +1 -1
- data/imgkit.gemspec +2 -2
- metadata +8 -7
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Create JPGs using plain old HTML+CSS. Uses [wkhtmltoimage](http://github.com/antialize/wkhtmltopdf) on the backend which renders HTML using Webkit.
|
4
4
|
|
5
|
+
Heavily based on [PDFKit](http://github.com/jdpace/pdfkit/).
|
6
|
+
|
5
7
|
## Install
|
6
8
|
|
7
9
|
### IMGKit
|
@@ -21,10 +23,10 @@ Create JPGs using plain old HTML+CSS. Uses [wkhtmltoimage](http://github.com/ant
|
|
21
23
|
kit = IMGKit.new(html, :quality => 50)
|
22
24
|
kit.stylesheets << '/path/to/css/file'
|
23
25
|
|
24
|
-
# Get
|
26
|
+
# Get the image BLOB
|
25
27
|
img = kit.to_img
|
26
28
|
|
27
|
-
# Save the
|
29
|
+
# Save the JPG to a file
|
28
30
|
file = kit.to_file('/path/to/save/file.jpg')
|
29
31
|
|
30
32
|
# IMGKit.new can optionally accept a URL or a File.
|
@@ -37,7 +39,7 @@ Create JPGs using plain old HTML+CSS. Uses [wkhtmltoimage](http://github.com/ant
|
|
37
39
|
|
38
40
|
## Configuration
|
39
41
|
|
40
|
-
If you're on Windows or you installed
|
42
|
+
If you're on Windows or you installed wkhtmltoimage by hand to a location other than /usr/local/bin you will need to tell PDFKit where the binary is. You can configure PDFKit like so:
|
41
43
|
|
42
44
|
# config/initializers/imgkit.rb
|
43
45
|
IMGKit.configure do |config|
|
@@ -48,13 +50,15 @@ If you're on Windows or you installed wkhtmltopdf by hand to a location other th
|
|
48
50
|
end
|
49
51
|
|
50
52
|
|
51
|
-
##
|
53
|
+
## Rails
|
54
|
+
|
55
|
+
### Mime Types
|
52
56
|
register a .jpg mime type in:
|
53
57
|
|
54
58
|
#config/initializers/mime_type.rb
|
55
59
|
Mime::Type.register "image/jpeg", :jpg
|
56
60
|
|
57
|
-
|
61
|
+
### Controller Actions
|
58
62
|
You can then send JPGs with
|
59
63
|
|
60
64
|
format.jpg do
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
1.0.0
|
data/imgkit.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{imgkit}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "1.0.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["csquared"]
|
12
|
-
s.date = %q{2010-12-
|
12
|
+
s.date = %q{2010-12-13}
|
13
13
|
s.default_executable = %q{imgkit}
|
14
14
|
s.description = %q{Uses wkhtmltoimage to create Images using HTML}
|
15
15
|
s.email = %q{christopher.continanza@gmail.com}
|
metadata
CHANGED
@@ -3,10 +3,10 @@ name: imgkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
|
+
- 1
|
6
7
|
- 0
|
7
|
-
-
|
8
|
-
|
9
|
-
version: 0.9.2
|
8
|
+
- 0
|
9
|
+
version: 1.0.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- csquared
|
@@ -14,12 +14,11 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-12-
|
17
|
+
date: 2010-12-13 00:00:00 -06:00
|
18
18
|
default_executable: imgkit
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rspec
|
22
|
-
prerelease: false
|
23
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
23
|
none: false
|
25
24
|
requirements:
|
@@ -33,10 +32,10 @@ dependencies:
|
|
33
32
|
- 8
|
34
33
|
version: 2.0.0.beta.8
|
35
34
|
type: :development
|
35
|
+
prerelease: false
|
36
36
|
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: rspec-core
|
39
|
-
prerelease: false
|
40
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
40
|
none: false
|
42
41
|
requirements:
|
@@ -50,10 +49,10 @@ dependencies:
|
|
50
49
|
- 8
|
51
50
|
version: 2.0.0.beta.8
|
52
51
|
type: :development
|
52
|
+
prerelease: false
|
53
53
|
version_requirements: *id002
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: mocha
|
56
|
-
prerelease: false
|
57
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
58
57
|
none: false
|
59
58
|
requirements:
|
@@ -63,6 +62,7 @@ dependencies:
|
|
63
62
|
- 0
|
64
63
|
version: "0"
|
65
64
|
type: :development
|
65
|
+
prerelease: false
|
66
66
|
version_requirements: *id003
|
67
67
|
description: Uses wkhtmltoimage to create Images using HTML
|
68
68
|
email: christopher.continanza@gmail.com
|
@@ -119,6 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
119
|
requirements:
|
120
120
|
- - ">="
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
+
hash: 420051578781479221
|
122
123
|
segments:
|
123
124
|
- 0
|
124
125
|
version: "0"
|