Piggy 0.4.2.4 → 0.4.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +15 -0
- data/INSTALL.txt +9 -4
- data/README.txt +8 -6
- data/bin/directory_diff +1 -1
- data/bin/ftp_browser +1 -1
- data/bin/piggy +1 -1
- data/lib/directory_diff.rb +8 -6
- data/lib/ftp_browser.rb +8 -6
- data/lib/icons/connect.ico +0 -0
- data/lib/icons/hide_details.ico +0 -0
- data/lib/icons/show_details.ico +0 -0
- data/lib/piggy-core/alive_check.rb +4 -4
- data/lib/piggy-core/debug.rb +4 -4
- data/lib/piggy-core/environment.rb +24 -26
- data/lib/piggy-core/exifr_adapter.rb +11 -11
- data/lib/piggy-core/file_info.rb +61 -61
- data/lib/piggy-core/ftp_adapter.rb +24 -24
- data/lib/piggy-core/htmlgen.rb +41 -45
- data/lib/piggy-core/nconvert_thumbsgen.rb +22 -22
- data/lib/piggy-core/options.rb +25 -19
- data/lib/piggy-core/options_persistence.rb +8 -8
- data/lib/piggy-core/progress.rb +7 -7
- data/lib/piggy-core/rmagick_thumbnail_page_generator.rb +14 -14
- data/lib/piggy-core/thumbnail_generator.rb +26 -26
- data/lib/piggy-core/thumbnail_page_generator.rb +234 -230
- data/lib/piggy-core/upload_info.rb +22 -22
- data/lib/piggy-core/version.rb +7 -7
- data/lib/piggy-core/winshell.rb +136 -80
- data/lib/piggy-gui/dir_chooser.rb +14 -14
- data/lib/piggy-gui/directory_diff_widget.rb +177 -160
- data/lib/piggy-gui/filtered_file_list.rb +87 -87
- data/lib/piggy-gui/fox_thumbsgen.rb +4 -4
- data/lib/piggy-gui/ftp_browser_widget.rb +211 -155
- data/lib/piggy-gui/fullscreen.rb +4 -4
- data/lib/piggy-gui/html_generation_dialog.rb +42 -115
- data/lib/piggy-gui/html_options_widget.rb +97 -0
- data/lib/piggy-gui/image_processor.rb +58 -58
- data/lib/piggy-gui/modal_dialog.rb +11 -5
- data/lib/piggy-gui/multiimagecanvas.rb +59 -59
- data/lib/piggy-gui/options_dialog.rb +170 -48
- data/lib/piggy-gui/piggy_image_browser.rb +382 -340
- data/lib/piggy-gui/pipe_log.rb +17 -17
- data/lib/piggy-gui/progress_with_dialog.rb +8 -8
- data/lib/piggy-gui/require-fox.rb +23 -8
- data/lib/piggy.rb +7 -5
- data/lib/templates/styles/basic/style.css +16 -14
- data/lib/templates/styles/black/style.css +28 -29
- data/lib/templates/styles/roundedbox/style.css +28 -31
- data/lib/templates/styles/shadow/style.css +26 -26
- data/lib/templates/styles/shadow_D9F5F3/style.css +1 -1
- data/lib/templates/styles/shadow_black/lo.jpg +0 -0
- data/lib/templates/styles/shadow_black/lu.jpg +0 -0
- data/lib/templates/styles/shadow_black/ro.jpg +0 -0
- data/lib/templates/styles/shadow_black/ru.jpg +0 -0
- data/lib/templates/styles/shadow_black/style.css +78 -0
- data/lib/templates/styles/shadow_bowers/style.css +48 -51
- data/lib/templates/styles/sylvester/sh.png +0 -0
- data/lib/templates/styles/sylvester/style.css +74 -0
- data/lib/templates/styles/sylvester/wunderkerze.jpg +0 -0
- data/test/file_info_test.rb +29 -29
- metadata +52 -38
@@ -15,65 +15,65 @@ class ThumbnailGenerator
|
|
15
15
|
@imageProcessor = imageProcessor
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
19
|
-
|
18
|
+
def set_output_directory dir
|
19
|
+
assert_dir dir
|
20
20
|
@outputDir = dir
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
24
|
-
return File.join(@outputDir,
|
23
|
+
def outname_big file
|
24
|
+
return File.join(@outputDir, name_of(file) + extension_of(file))
|
25
25
|
end
|
26
26
|
|
27
|
-
def
|
28
|
-
return File.join(@outputDir, PreThumbs +
|
27
|
+
def outname_small file
|
28
|
+
return File.join(@outputDir, PreThumbs + name_of(file) + extension_of(file))
|
29
29
|
end
|
30
30
|
|
31
31
|
def generate(infos, progress)
|
32
|
-
|
33
|
-
|
34
|
-
progress.
|
32
|
+
src_files = infos.collect { |info| info.name_with_path }
|
33
|
+
assert_files src_files
|
34
|
+
progress.set_task("Processing images", src_files.size)
|
35
35
|
infos.each do
|
36
36
|
|info|
|
37
|
-
inputFile = info.
|
38
|
-
progress.
|
39
|
-
img = @imageProcessor.
|
37
|
+
inputFile = info.name_with_path
|
38
|
+
progress.set_progress("Processing #{File.basename(inputFile)}", 1)
|
39
|
+
img = @imageProcessor.load_image inputFile
|
40
40
|
if(info.rotate?)
|
41
|
-
|
41
|
+
@imageProcessor.rotate_image(img, info.rotation)
|
42
42
|
end
|
43
|
-
@imageProcessor.
|
44
|
-
@imageProcessor.
|
45
|
-
@imageProcessor.
|
46
|
-
@imageProcessor.
|
47
|
-
@imageProcessor.
|
43
|
+
@imageProcessor.fit_image(img, @options.imageWidth, @options.imageHeight)
|
44
|
+
@imageProcessor.save_image(img, outname_big(inputFile))
|
45
|
+
@imageProcessor.fit_image(img, @options.thumbWidth, @options.thumbHeight)
|
46
|
+
@imageProcessor.save_image(img, outname_small(inputFile))
|
47
|
+
@imageProcessor.garbage_image(img)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
protected
|
52
52
|
|
53
|
-
def
|
53
|
+
def extension_of file
|
54
54
|
return '.' + file.split('.')[-1]
|
55
55
|
end
|
56
56
|
|
57
|
-
def
|
58
|
-
File.basename file,
|
57
|
+
def name_of file
|
58
|
+
File.basename file, extension_of(file)
|
59
59
|
end
|
60
60
|
|
61
|
-
def
|
61
|
+
def assert_dir dir
|
62
62
|
if !File.directory? dir
|
63
63
|
raise "directory #{dir} doesn't exist"
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
def
|
67
|
+
def assert_file file
|
68
68
|
if !File.exist? file
|
69
69
|
raise "file #{file} doesn't exist"
|
70
70
|
end
|
71
|
-
if !@imageProcessor.
|
71
|
+
if !@imageProcessor.is_supported_image_file? file
|
72
72
|
raise "file #{file} not supported"
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
def
|
77
|
-
files.each { |file|
|
76
|
+
def assert_files files
|
77
|
+
files.each { |file| assert_file file }
|
78
78
|
end
|
79
79
|
end
|