patch-mapivi 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. $OpenBSD: patch-mapivi,v 1.7 2014/04/25 09:47:50 sthen Exp $
  2. --- mapivi.orig Thu Feb 21 20:53:44 2008
  3. +++ mapivi Sun Jul 14 12:07:09 2013
  4. @@ -148,12 +148,12 @@ if (($EvilOS) and (defined $ENV{APPDATA}) and ($maprog
  5. # for windows we use this path
  6. $maprogsdir = $ENV{APPDATA}."/maprogs" if defined $ENV{APPDATA};
  7. my $configdir = "$maprogsdir/mapivi"; # the configuration dir
  8. -my $icon_path = "$configdir/icons"; # the icon dir
  9. +my $icon_path = "${PREFIX}/share/mapivi/icons"; # the icon dir
  10. my $splashAvail = (eval "require Tk::Splash") ? 1 : 0 ;
  11. my $splash;
  12. -my $logo = "$configdir/logo.jpg";
  13. -if ($splashAvail and -f $logo) {
  14. +my $logo = "${PREFIX}/share/mapivi/pics/logo.jpg";
  15. +if ($splashAvail and -f $logo and -d $configdir) {
  16. # Splash->Show parameters: $image, $width, $height, $title, $overrideredirect
  17. $splash = Tk::Splash->Show($logo, 844, 259, "", 1);
  18. }
  19. @@ -360,7 +360,7 @@ my $nrToConvert = 0;
  20. my $maxCommentLength = 2**16 - 3; # a comment block may have max 64kB
  21. my $trashdir = "$configdir/trash"; # the trashcan
  22. -my $plugindir = "$configdir/PlugIns"; # the mapivi plugin dir
  23. +my $plugindir = "${PREFIX}/share/mapivi/PlugIns"; # the mapivi plugin dir
  24. my $iptcdir = "$configdir/IPTC_templates"; # the IPTC templates folder
  25. my $configFile = "$configdir/mapivirc"; # the configuration file
  26. my $file_Entry_values = "$configdir/Entry_values";
  27. @@ -445,7 +445,7 @@ my %new_keywords;
  28. my %ignore_keywords;
  29. # external programs used by mapivi
  30. -my %exprogs = qw/convert 0 composite 0 jhead 0 jpegtran 0 jpegpixi 0 mogrify 0 gimp-remote 0 gimp-win-remote 0 montage 0 xwd 0 identify 0 thunderbird 0 mozilla-thunderbird 0 exiftool 0/;
  31. +my %exprogs = qw/convert 0 composite 0 jhead 0 jpegtran 0 jpegpixi 0 mogrify 0 gimp 0 montage 0 identify 0 exiftool 0/;
  32. # short comment about the usage of the external programs
  33. my %exprogscom = (
  34. "convert" => "build thumbnails",
  35. @@ -455,12 +455,9 @@ my %exprogscom = (
  36. "jpegpixi" => "do nearly lossless interpolation (remove dead pixels)",
  37. "mogrify" => "change the size/quality of pictures",
  38. "montage" => "combine pictures to e.g. index prints",
  39. - "gimp-remote" => "edit pictures with The GIMP (only UNIX)",
  40. - "gimp-win-remote"=> "edit pictures with The GIMP (only windows)",
  41. - "xwd" => "make a screenshot of a window or desktop",
  42. + "gimp" => "edit pictures with The GIMP (only UNIX)",
  43. "identify" => "describe the format and characteristics of a picture",
  44. "thunderbird" => "send pictures via email",
  45. - "mozilla-thunderbird" => "send pictures via email",
  46. "exiftool" => "Read/write meta information in image files",
  47. );
  48. # where to find the external programs (resources)
  49. @@ -472,11 +469,9 @@ my %exprogsres = (
  50. "jpegpixi" => "http://www.zero-based.org/software/jpegpixi/",
  51. "mogrify" => "Image Magick http://www.imagemagick.org",
  52. "montage" => "Image Magick http://www.imagemagick.org",
  53. - "gimp-remote" => "The GIMP http://www.gimp.org",
  54. - "gimp-win-remote"=> "gimp-win-remote http://sourceforge.net/projects/gimp-win-remote/",
  55. + "gimp" => "The GIMP http://www.gimp.org",
  56. "identify" => "Image Magick http://www.imagemagick.org",
  57. "thunderbird" => "http://www.mozilla.org/projects/thunderbird/",
  58. - "mozilla-thunderbird" => "http://www.mozilla.org/projects/thunderbird/",
  59. "exiftool" => "http://owl.phy.queensu.ca/~phil/exiftool/",
  60. );
  61. @@ -544,7 +539,7 @@ my %config = (
  62. "ColorThumbBG" => "azure3",
  63. "ColorProgress" => "#106dba",
  64. "ColorPicker" => "#efefef", # last color selected with color picker
  65. - "DefaultThumb" => "$configdir/EmptyThumb.jpg",
  66. + "DefaultThumb" => "${PREFIX}/share/mapivi/pics/EmptyThumb.jpg",
  67. "Copyright" => "copyright (c) $copyright_year Herrmann",
  68. "Comment" => "This picture was taken in south africa ...",
  69. "MaxProcs" => 1,
  70. @@ -739,7 +734,6 @@ my %config = (
  71. "LineLength" => 30, # length of one line in the thumbnail table e.g. for comments
  72. "ExtViewer" => 'display', # name of external picture viewer
  73. "ExtViewerMulti" => 0, # bool
  74. - "ExtBGApp" => "wmsetbg -a", # name of external app to set desktop background (with options)
  75. "ConvertUmlaut" => 1, # convert german umlaute (e.g. ä -> ae etc.)
  76. "DeadPixelStr" => "1300,846,3 85,411,3 7,365,3 1529,185,3 1593,201,3 1387,1003,3 1957,1057,3 50,1043,2 615,935,3", # info about the dead pixels of your camera see: http://www.zero-based.org/software/jpegpixi/
  77. "DeadPixelMethod" => "linear",
  78. @@ -795,7 +789,7 @@ my %config = (
  79. "MailPicNoChange" => 0,
  80. "MailPicMaxLength"=> 800,
  81. "MailPicQuality" => 75,
  82. - "MailTool" => 'mozilla-thunderbird',
  83. + "MailTool" => 'thunderbird',
  84. "winDirRequesterAskAgain" => 1,
  85. "FuzzyBorderWidth"=> 10,
  86. "FuzzyBorderBlur" => 10,
  87. @@ -1083,7 +1077,7 @@ ENIIJZtY4oUFGKCwQgw13KBDDz8UcUQTPlBc0cUSAhEEwAANVLBBCC
  88. dKyyLnF00kjQlkTSR9GqxBKzyS6bEbY0EestAAEBADs=
  89. EOF
  90. my $mapiviicon = $top->Photo(-data => $icon_data);
  91. -my $mapiviiconfile = "$configdir/MapiviIcon.gif";
  92. +my $mapiviiconfile = "$icon_path/MapiviIcon.gif";
  93. $mapiviiconfile = "$configdir/MapiviIcon32.gif" if $EvilOS;
  94. #my $mapiviicon = $top->Photo(-file => $mapiviiconfile) if (-f $mapiviiconfile);
  95. $top->idletasks if $EvilOS; # this line is crucial (at least on windows)
  96. @@ -10153,11 +10147,11 @@ sub decorationDialog {
  97. my $pf = $pfa->Frame(-bd => $config{Borderwidth}, -relief => 'groove')->pack(-side => "left");
  98. my $pfn = $pf->Frame()->pack();
  99. my $pfs = $pf->Frame()->pack();
  100. - foreach my $gravity qw(NorthWest North NorthEast) {
  101. + foreach my $gravity (qw(NorthWest North NorthEast)) {
  102. my $but = $pfn->Radiobutton(-text => "", -variable => \$config{CopyPosition}, -value => $gravity)->pack(-side => 'left');
  103. $balloon->attach($but, -msg => "Align the copyright text or logo in $gravity position");
  104. }
  105. - foreach my $gravity qw(SouthWest South SouthEast) {
  106. + foreach my $gravity (qw(SouthWest South SouthEast)) {
  107. my $but = $pfs->Radiobutton(-text => "", -variable => \$config{CopyPosition}, -value => $gravity)->pack(-side => 'left');
  108. $balloon->attach($but, -msg => "Align the copyright text or logo in $gravity position");
  109. }
  110. @@ -13567,8 +13561,6 @@ sub createMenubar {
  111. }
  112. slideshow();
  113. }, -accelerator => "<s>");
  114. - $view_menu->command(-label => "use actual picture as desktop background",
  115. - -command => \&setBackground);
  116. $view_menu->separator;
  117. my $layout_menu = $view_menu->cascade(-label => "Window layout ...");
  118. @@ -13719,7 +13711,7 @@ sub addPicProcessing {
  119. $border_menu->command(-image => compound_menu($top, 'add relative border (lossless) ...', ''), -command => sub { losslessBorder(RELATIVE); } );
  120. $border_menu->command(-image => compound_menu($top, 'add border or copyright (lossy) ...', ''), -command => \&addDecoration);
  121. - $menu->command(-image => compound_menu($top, 'edit in GIMP', 'applications-graphics.png'), -command => \&GIMPedit, -accelerator => "<Ctrl-e>") unless ($exprogs{"gimp-remote"} or $exprogs{"gimp-win-remote"});
  122. + $menu->command(-image => compound_menu($top, 'edit in GIMP', 'applications-graphics.png'), -command => \&GIMPedit, -accelerator => "<Ctrl-e>") unless ($exprogs{"gimp"} or $exprogs{"gimp-win-remote"});
  123. }
  124. ##############################################################
  125. @@ -16381,7 +16373,7 @@ sub makeButton {
  126. my $picName = shift;
  127. my $func = shift;
  128. - my $pic = "$configdir/$picName";
  129. + my $pic = "${PREFIX}/share/mapivi/$picName";
  130. my $image = $parentWidget->Photo(-file => $pic) if -f $pic;
  131. if ($image) {
  132. @@ -20002,7 +19994,7 @@ sub plusMinusEntry {
  133. ##############################################################
  134. sub normalizeCoords {
  135. my $canvas = shift;
  136. - foreach my $coord qw(m_x1 m_x2 m_y1 m_y2) {
  137. + foreach my $coord (qw(m_x1 m_x2 m_y1 m_y2)) {
  138. # assign it to the step width
  139. $canvas->{$coord} = sprintf "%.0f", ($canvas->{$coord}/$canvas->{m_step});
  140. $canvas->{$coord} *= $canvas->{m_step};
  141. @@ -20011,10 +20003,10 @@ sub normalizeCoords {
  142. }
  143. # check upper bound
  144. - foreach my $coord qw(m_x1 m_x2) {
  145. + foreach my $coord (qw(m_x1 m_x2)) {
  146. $canvas->{$coord} = $canvas->{m_wo} if ($canvas->{$coord} > $canvas->{m_wo});
  147. }
  148. - foreach my $coord qw(m_y1 m_y2) {
  149. + foreach my $coord (qw(m_y1 m_y2)) {
  150. $canvas->{$coord} = $canvas->{m_ho} if ($canvas->{$coord} > $canvas->{m_ho});
  151. }
  152. }
  153. @@ -25675,7 +25667,7 @@ sub GIMPedit {
  154. return if (!checkExternProgs("GIMPedit", "gimp-win-remote"));
  155. }
  156. else {
  157. - if (!checkExternProgs("GIMPedit", "gimp-remote")){
  158. + if (!checkExternProgs("GIMPedit", "gimp")){
  159. $dpic = $sellist[0];
  160. $pic = basename($dpic);
  161. my $rc = $top->messageBox(-icon => "question",
  162. @@ -25698,7 +25690,7 @@ sub GIMPedit {
  163. # check if file is a link and get the real target
  164. next if (!getRealFile(\$dpic));
  165. - my $command = "gimp-remote -n \"$dpic\" ";
  166. + my $command = "gimp \"$dpic\" ";
  167. #$command = "gimp-win-remote \"$dpic\" " if $EvilOS; # GIMP <= 2.0
  168. $command = "gimp-win-remote gimp-2.2.exe \"$dpic\" " if $EvilOS; # GIMP > 2.0
  169. $command .= "2>&1 1>/dev/null &" if (!$EvilOS);