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.
Files changed (61) hide show
  1. data/CHANGES.txt +15 -0
  2. data/INSTALL.txt +9 -4
  3. data/README.txt +8 -6
  4. data/bin/directory_diff +1 -1
  5. data/bin/ftp_browser +1 -1
  6. data/bin/piggy +1 -1
  7. data/lib/directory_diff.rb +8 -6
  8. data/lib/ftp_browser.rb +8 -6
  9. data/lib/icons/connect.ico +0 -0
  10. data/lib/icons/hide_details.ico +0 -0
  11. data/lib/icons/show_details.ico +0 -0
  12. data/lib/piggy-core/alive_check.rb +4 -4
  13. data/lib/piggy-core/debug.rb +4 -4
  14. data/lib/piggy-core/environment.rb +24 -26
  15. data/lib/piggy-core/exifr_adapter.rb +11 -11
  16. data/lib/piggy-core/file_info.rb +61 -61
  17. data/lib/piggy-core/ftp_adapter.rb +24 -24
  18. data/lib/piggy-core/htmlgen.rb +41 -45
  19. data/lib/piggy-core/nconvert_thumbsgen.rb +22 -22
  20. data/lib/piggy-core/options.rb +25 -19
  21. data/lib/piggy-core/options_persistence.rb +8 -8
  22. data/lib/piggy-core/progress.rb +7 -7
  23. data/lib/piggy-core/rmagick_thumbnail_page_generator.rb +14 -14
  24. data/lib/piggy-core/thumbnail_generator.rb +26 -26
  25. data/lib/piggy-core/thumbnail_page_generator.rb +234 -230
  26. data/lib/piggy-core/upload_info.rb +22 -22
  27. data/lib/piggy-core/version.rb +7 -7
  28. data/lib/piggy-core/winshell.rb +136 -80
  29. data/lib/piggy-gui/dir_chooser.rb +14 -14
  30. data/lib/piggy-gui/directory_diff_widget.rb +177 -160
  31. data/lib/piggy-gui/filtered_file_list.rb +87 -87
  32. data/lib/piggy-gui/fox_thumbsgen.rb +4 -4
  33. data/lib/piggy-gui/ftp_browser_widget.rb +211 -155
  34. data/lib/piggy-gui/fullscreen.rb +4 -4
  35. data/lib/piggy-gui/html_generation_dialog.rb +42 -115
  36. data/lib/piggy-gui/html_options_widget.rb +97 -0
  37. data/lib/piggy-gui/image_processor.rb +58 -58
  38. data/lib/piggy-gui/modal_dialog.rb +11 -5
  39. data/lib/piggy-gui/multiimagecanvas.rb +59 -59
  40. data/lib/piggy-gui/options_dialog.rb +170 -48
  41. data/lib/piggy-gui/piggy_image_browser.rb +382 -340
  42. data/lib/piggy-gui/pipe_log.rb +17 -17
  43. data/lib/piggy-gui/progress_with_dialog.rb +8 -8
  44. data/lib/piggy-gui/require-fox.rb +23 -8
  45. data/lib/piggy.rb +7 -5
  46. data/lib/templates/styles/basic/style.css +16 -14
  47. data/lib/templates/styles/black/style.css +28 -29
  48. data/lib/templates/styles/roundedbox/style.css +28 -31
  49. data/lib/templates/styles/shadow/style.css +26 -26
  50. data/lib/templates/styles/shadow_D9F5F3/style.css +1 -1
  51. data/lib/templates/styles/shadow_black/lo.jpg +0 -0
  52. data/lib/templates/styles/shadow_black/lu.jpg +0 -0
  53. data/lib/templates/styles/shadow_black/ro.jpg +0 -0
  54. data/lib/templates/styles/shadow_black/ru.jpg +0 -0
  55. data/lib/templates/styles/shadow_black/style.css +78 -0
  56. data/lib/templates/styles/shadow_bowers/style.css +48 -51
  57. data/lib/templates/styles/sylvester/sh.png +0 -0
  58. data/lib/templates/styles/sylvester/style.css +74 -0
  59. data/lib/templates/styles/sylvester/wunderkerze.jpg +0 -0
  60. data/test/file_info_test.rb +29 -29
  61. metadata +52 -38
@@ -15,65 +15,65 @@ class ThumbnailGenerator
15
15
  @imageProcessor = imageProcessor
16
16
  end
17
17
 
18
- def setOutputDirectory dir
19
- assertDir dir
18
+ def set_output_directory dir
19
+ assert_dir dir
20
20
  @outputDir = dir
21
21
  end
22
22
 
23
- def outnameBig file
24
- return File.join(@outputDir, nameOf(file) + extensionOf(file))
23
+ def outname_big file
24
+ return File.join(@outputDir, name_of(file) + extension_of(file))
25
25
  end
26
26
 
27
- def outnameSmall file
28
- return File.join(@outputDir, PreThumbs + nameOf(file) + extensionOf(file))
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
- srcFiles = infos.collect { |info| info.nameWithPath }
33
- assertFiles srcFiles
34
- progress.setTask("Processing images", srcFiles.size)
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.nameWithPath
38
- progress.setProgress("Processing #{File.basename(inputFile)}", 1)
39
- img = @imageProcessor.loadImage inputFile
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
- @imageProcessor.rotateImage(img, info.rotation)
41
+ @imageProcessor.rotate_image(img, info.rotation)
42
42
  end
43
- @imageProcessor.fitImage(img, @options.imageWidth, @options.imageHeight)
44
- @imageProcessor.saveImage(img, outnameBig(inputFile))
45
- @imageProcessor.fitImage(img, @options.thumbWidth, @options.thumbHeight)
46
- @imageProcessor.saveImage(img, outnameSmall(inputFile))
47
- @imageProcessor.garbageImage(img)
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 extensionOf file
53
+ def extension_of file
54
54
  return '.' + file.split('.')[-1]
55
55
  end
56
56
 
57
- def nameOf file
58
- File.basename file, extensionOf(file)
57
+ def name_of file
58
+ File.basename file, extension_of(file)
59
59
  end
60
60
 
61
- def assertDir dir
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 assertFile file
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.isSupportedImageFile? file
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 assertFiles files
77
- files.each { |file| assertFile file }
76
+ def assert_files files
77
+ files.each { |file| assert_file file }
78
78
  end
79
79
  end