annotate debian/patches/18_bins-memory-leak @ 6:3021deef1599

Encoding related fixes * chomp encoding string * reformat else (seems someone hacked it in) * debug print encoding * do not use :utf8 binmode ("re-encode") on written file if the input is _already_ UTF-8
author Peter Gervai <grin@grin.hu>
date Thu, 16 Oct 2008 00:02:14 +0200
parents c5749e43b1d7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
1 #! /bin/sh /usr/share/dpatch/dpatch-run
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
2 ## 18_bins-1.1.29-memory-leak.dpatch by <rousseau@localhost.localdomain>
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
3 ##
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
4 ## All lines beginning with `## DP:' are a description of the patch.
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
5 ## DP: No description.
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
6
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
7 @DPATCH@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
8 --- bins-1.1.29.orig/bins
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
9 +++ bins-1.1.29/bins
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
10 @@ -449,13 +449,13 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
11 $defaultConfig{fileActiveSizeNames} = \@fileActiveSizeNames;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
12
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
13 # Fields to display (in the list order) under the picture. These
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
14 -# fields are defined in the getFields function below.
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
15 +# fields are defined in the %fields hash below.
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
16 my @mainFields = ("description", "people", "location", "date",
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
17 "event", "comment");
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
18
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
19
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
20 # Fields to display (in the list order) in the details page. These
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
21 -# fields are in the getFields function below.
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
22 +# fields are in the %fields hash below.
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
23 my @secondaryFields = (
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
24 # DigiCam
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
25 _("BINS-SECTION DigiCam Info"),
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
26 @@ -519,7 +519,6 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
27 "BINS-SECTION end", # close the last section
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
28 );
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
29
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
30 -sub getFields {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
31 # The key is the string used as the name in the picture
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
32 # description file.
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
33 # Name corresponds to the string displayed under the picture.
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
34 @@ -527,9 +526,8 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
35 # found in some JPEG images.
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
36 # The value of the EXIF structure is only used if no value
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
37 # is present in the picture description file.
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
38 - # Transform is a Perl operator used to convert an exif value
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
39 - # to the desired format to display. It is evaluated as
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
40 - # normal Perl code and the result has to be in $_.
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
41 + # Note: See also postProcessHashArrays() for dateString related
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
42 + # items
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
43 my %fields =
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
44 (
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
45 "title" =>
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
46 @@ -547,12 +545,6 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
47 "date" =>
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
48 { Name => _("Date"),
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
49 EXIF => "DateTimeOriginal",
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
50 - Transform => '$_ = local2html(strftime $configHash->{dateString}, localtime str2time "$_") if str2time "$_"',
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
51 - # Alternatively, you could use regex substitution:
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
52 - # English version is yyyy:mm:dd hh:mm:ss to yyyy/mm/dd hh:mm:ss :
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
53 - # Transform => 's%^(\\d+):(\\d+):(\\d+) (.*)$%\$1/\$2/\$3 \$4%',
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
54 - # French version is yyyy:mm:dd hh:mm:ss to dd/mm/yyyy hh:mm:ss :
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
55 - # Transform => 's%^(\d+):(\d+):(\d+) (.*)$%$3/$2/$1 $4%',
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
56 },
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
57
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
58 "event" =>
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
59 @@ -822,8 +814,6 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
60 Tip => _("Indicates the image sensor type on the camera or input device."),
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
61 },
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
62 );
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
63 - return \%fields;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
64 -}
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
65
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
66 my @priorityExifTags = (); # the field in this list are taken from
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
67 # the desc file, even if they are present
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
68 @@ -847,10 +837,10 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
69 });
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
70 $defaultConfig{colorsSubs} = \%colorsSubs;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
71
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
72 -sub getIntlSubs{
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
73 - my $configHash = shift;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
74 - # Strings to translate in the HTML template pages (if I18N is used)
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
75 - my %intlSubs = ( STRING_THUMBNAILS => _("thumbnails"),
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
76 +# Strings to translate in the HTML template pages (if I18N is used)
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
77 +# Note: See also postProcessHashArrays() for dateString related
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
78 +# items
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
79 +my %intlSubs = ( STRING_THUMBNAILS => _("thumbnails"),
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
80 STRING_IMAGELIST => _("Image List"),
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
81 STRING_HOME => _("Home"),
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
82 STRING_ALBUM => _("Album"),
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
83 @@ -882,13 +872,11 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
84 BINS_VERSION => "1.1.29",
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
85 ENCODING => $defaultConfig{htmlEncoding},
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
86 GENERATED_DATE => _("on ").
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
87 - local2html(strftime($configHash->{dateString},
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
88 + local2html(strftime($defaultConfig{dateString},
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
89 localtime)),
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
90 BINS_ID =>
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
91 '<!--$Id: bins,v 1.182 2005/08/22 23:52:33 jerome Exp $-->',
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
92 );
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
93 - return \%intlSubs;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
94 -}
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
95
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
96 # @knownImageExtentions defines file extensions that BINS can handle as
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
97 # input image. BINS _should_ handle all input format of ImageMagick
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
98 @@ -925,6 +913,7 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
99 sub beVerboseN;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
100 sub min;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
101 sub readConfigFile;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
102 +sub postProcessHashArrays;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
103 sub fileSize;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
104 sub generateAlbumPages;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
105 sub filenameToPreviewName;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
106 @@ -942,8 +931,6 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
107 sub trimWhiteSpace;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
108 sub stringToBool;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
109 sub ignoreSet;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
110 -sub getFields;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
111 -sub getIntlSubs;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
112
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
113 sub generateThumbnailPages;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
114 sub generateThumbEntry;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
115 @@ -1015,6 +1002,27 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
116 return \%option;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
117 }
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
118
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
119 +# process hash arrays after reading config file
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
120 +# a non-default value of dateString might have been read from the
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
121 +# configuration file, so the proper values must be inserted into the
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
122 +# %fields and %intlSubs hash arrays
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
123 +sub postProcessHashArrays {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
124 + my $configHash = shift;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
125 +
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
126 + # Transform is a Perl operator used to convert an exif value
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
127 + # to the desired format to display. It is evaluated as
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
128 + # normal Perl code and the result has to be in $_.
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
129 + $fields{date}{Transform} =
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
130 + '$_ = local2html(strftime $configHash->{dateString}, localtime str2time "$_")';
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
131 + # Alternatively, you could use regex substitution:
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
132 + # English version is yyyy:mm:dd hh:mm:ss to yyyy/mm/dd hh:mm:ss :
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
133 + # Transform => 's%^(\\d+):(\\d+):(\\d+) (.*)$%\$1/\$2/\$3 \$4%',
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
134 + # French version is yyyy:mm:dd hh:mm:ss to dd/mm/yyyy hh:mm:ss :
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
135 + # Transform => 's%^(\d+):(\d+):(\d+) (.*)$%$3/$2/$1 $4%',
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
136 + $intlSubs{GENERATED_DATE} = _("on ").
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
137 + local2html(strftime($configHash->{dateString}, localtime)),
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
138 +}
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
139 +
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
140 # process command line arguments after reading config file
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
141 sub postProcessArgs {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
142 my $option = shift;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
143 @@ -1272,6 +1280,9 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
144 #?read configurations files
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
145 my $defaultConfig = readConfigFile(\%defaultConfig);
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
146
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
147 + # post process %fields and %intlSubs hash arrays
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
148 + postProcessHashArrays($defaultConfig);
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
149 +
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
150 # post process command line args after reading config files
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
151 postProcessArgs($options, $defaultConfig);
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
152
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
153 @@ -2962,7 +2973,7 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
154 $sectionTitle = $tagName;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
155 $sectionTitle =~ s/^BINS-SECTION //;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
156 }else{
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
157 - $tagValue = getFields($configHash)->{$tagName};
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
158 + $tagValue = $fields{$tagName};
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
159 if ($imageInfo->{$tagName}) {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
160 my %row = (FIELD_NAME => $tagValue->{'Name'},
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
161 FIELD_VALUE => local2html($imageInfo->{$tagName})
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
162 @@ -3017,7 +3028,7 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
163 $subs_hash{CUSTOM_CSS} = $configHash->{customStyleSheet};
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
164
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
165 my @array;
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
166 - push @array, {NAV_NAME => getIntlSubs($configHash)->{STRING_BACKTOTHEIMAGE},
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
167 + push @array, {NAV_NAME => $intlSubs{STRING_BACKTOTHEIMAGE},
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
168 NAV_LINK => "javascript:history.back();",
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
169 NAV_ICON => "back.png",
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
170 NAV_ID => "back"};
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
171 @@ -3674,7 +3685,7 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
172 if (${%$hashref}{$tagName}) {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
173 my $value=${%$hashref}{$tagName};
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
174 $value =~ s/'/&#39;/g ; # in case it's used in javascript code
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
175 - push @descTable, {DESC_FIELD_NAME => getFields($configHash)->{$tagName}->{'Name'},
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
176 + push @descTable, {DESC_FIELD_NAME => $fields{$tagName}->{'Name'},
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
177 DESC_FIELD_VALUE => $value,
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
178 };
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
179 }
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
180 @@ -3819,7 +3830,7 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
181 %{$templateParameters} =
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
182 (%{$templateParameters},
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
183 %{$configHash->{colorsSubs}{$configHash->{colorStyle}}},
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
184 - %{getIntlSubs($configHash)},
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
185 + %intlSubs,
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
186 );
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
187
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
188 # open the html template
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
189 @@ -3951,7 +3962,7 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
190 && $element->{Name} eq "field") {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
191 $fieldName = $element->{Attributes}{'name'};
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
192 $fieldValue = "";
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
193 - if (grep (/^$fieldName$/, keys(%{getFields($configHash)}))) {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
194 + if (grep (/^$fieldName$/, keys(%fields))) {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
195 beVerbose(" Reading field '$fieldName':", 3);
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
196 foreach my $characters (@{$element->{Contents}}) {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
197 #if (UNIVERSAL::isa($characters, 'XML::Grove::Characters')) {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
198 @@ -4377,13 +4388,13 @@
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
199 }
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
200
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
201 # add value to desc Hash if field is void
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
202 - foreach my $field (keys(%{getFields($configHash)})) {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
203 - my $fieldExif = getFields($configHash)->{$field}->{'EXIF'};
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
204 + foreach my $field (keys(%fields)) {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
205 + my $fieldExif = $fields{$field}->{'EXIF'};
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
206 if ((! $descHash->{$field}) && $fieldExif && $exifHash->{$fieldExif}) {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
207 beVerboseN(" Using '$field' from EXIF data: ".
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
208 $exifHash->{$fieldExif}, 3);
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
209
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
210 - my $func = getFields($configHash)->{$field}->{'Transform'};
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
211 + my $func = $fields{$field}->{'Transform'};
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
212 if ($func) {
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
213 $_ = $exifHash->{$fieldExif};
c5749e43b1d7 Adding debian files (to original 1.1.29)
Peter Gervai <grin@grin.hu>
parents:
diff changeset
214 beVerbose(" Evaluating '$func' from '$_'", 4);