retina_image_tag 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +20 -3
- data/lib/retina_image_tag/version.rb +1 -1
- data/retina_image_tag.gemspec +1 -1
- metadata +5 -5
data/README.md
CHANGED
@@ -1,6 +1,26 @@
|
|
1
1
|
# retina_image_tag
|
2
2
|
|
3
|
+
### How it Works
|
3
4
|
retina_image_tag is a ViewHelper for Rails 3.1. in contrast to the normal Rails image_tag knows the retina_image_tag if the user invokes an image on a Apple Retina Display.
|
5
|
+
When the page loads on the screen, a cookie hold the devicePixelRatio set by JavaScript.
|
6
|
+
When an image is requested by the server, retina_image_tag checks for the following.
|
7
|
+
A cookie holding devicePixelRatio exists.
|
8
|
+
The value set in the cookie is greater than 1.
|
9
|
+
If any of the above are false, it will send the regular image.
|
10
|
+
Otherwise, the high-res image is sent.
|
11
|
+
|
12
|
+
### Example
|
13
|
+
herokuapp: <http://retinaimagetag.herokuapp.com/>
|
14
|
+
|
15
|
+
sourcecode: <https://github.com/ffaerber/retina_image_tag_demoapp/>
|
16
|
+
|
17
|
+
|
18
|
+
### Benfits
|
19
|
+
* Only one image is loaded by the view.
|
20
|
+
* compatible with the rails 3 assetpipline. like assethost and assets:precompile
|
21
|
+
* no photoshop is needed, an rake task is includet for downsclaing to normal size.
|
22
|
+
* Compatible with Carrierwave for user genereted retina images
|
23
|
+
* Fallback to regular image if JavaScript and Cookies are disabled.
|
4
24
|
|
5
25
|
|
6
26
|
### Retina Display
|
@@ -10,10 +30,7 @@ You can think about a full screen display with dimensions of 320x480 for iPhone4
|
|
10
30
|
### @2x
|
11
31
|
The '@2x' naming convention will be instantly familiar to any iOS developer. It's simply a way of naming an alternate, high-resolution version of an image so that it will be recognized and used by high-resolution Retina Displays.
|
12
32
|
|
13
|
-
### Example
|
14
|
-
herokuapp: <http://retinaimagetag.herokuapp.com/>
|
15
33
|
|
16
|
-
sourcecode: <https://github.com/ffaerber/retina_image_tag_demoapp/>
|
17
34
|
|
18
35
|
|
19
36
|
|
data/retina_image_tag.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: retina_image_tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: 2.12.0
|
54
|
-
type: :
|
54
|
+
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
segments:
|
98
98
|
- 0
|
99
|
-
hash:
|
99
|
+
hash: 4292291273661147220
|
100
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
101
|
none: false
|
102
102
|
requirements:
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
segments:
|
107
107
|
- 0
|
108
|
-
hash:
|
108
|
+
hash: 4292291273661147220
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
111
|
rubygems_version: 1.8.23
|