myimdb 0.3.8 → 0.3.9
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/VERSION +1 -1
- data/bin/myimdb-catalogue +17 -1
- data/myimdb.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.9
|
data/bin/myimdb-catalogue
CHANGED
@@ -9,6 +9,14 @@ class Platform
|
|
9
9
|
def windows?
|
10
10
|
RUBY_PLATFORM =~ /mswin|windows|mingw/i
|
11
11
|
end
|
12
|
+
|
13
|
+
def xp?
|
14
|
+
ENV["ALLUSERSPROFILE"] =~ /Documents and Settings/
|
15
|
+
end
|
16
|
+
|
17
|
+
def vista_or_later?
|
18
|
+
!xp?
|
19
|
+
end
|
12
20
|
|
13
21
|
def mac?
|
14
22
|
RUBY_PLATFORM =~ /darwin/i
|
@@ -85,6 +93,14 @@ def icon_file_name
|
|
85
93
|
end
|
86
94
|
end
|
87
95
|
|
96
|
+
def icon_size
|
97
|
+
if Platform.windows?
|
98
|
+
Platform.vista_or_later? ? '256x256' : '128x128'
|
99
|
+
else
|
100
|
+
'512x512'
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
88
104
|
def filtered_movie_name(name)
|
89
105
|
name.gsub(/\[.*?\]/,'').strip
|
90
106
|
end
|
@@ -109,7 +125,7 @@ def repair_permissions_for(target_dir)
|
|
109
125
|
end
|
110
126
|
|
111
127
|
def convert_to_icon(image_file_path, icon_file_path)
|
112
|
-
`convert "#{image_file_path}" -thumbnail
|
128
|
+
`convert "#{image_file_path}" -thumbnail #{icon_size} -gravity center -crop #{icon_size}+0+0! -background transparent -flatten "#{icon_file_path}"`
|
113
129
|
end
|
114
130
|
|
115
131
|
def save_image(target_dir, name, image_index=0)
|
data/myimdb.gemspec
CHANGED