File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -185,10 +185,10 @@ func getOcrFilesFromAnnotationList(annotations []model.ResourceAnnotation) []str
185
185
186
186
// getMetsOcrFileNames creates the array of file names from the METS file.
187
187
func getMetsOcrFileNames (metsReader io.Reader ) []string {
188
- var fileNames = make ([]string , 50 )
188
+ var fileNames = make ([]string , 100 )
189
189
parser := xml .NewDecoder (metsReader )
190
190
ocrFileElement := false
191
- altoCounter := 0
191
+ ocrCounter := 0
192
192
for {
193
193
token , err := parser .Token ()
194
194
if err != nil {
@@ -208,13 +208,13 @@ func getMetsOcrFileNames(metsReader io.Reader) []string {
208
208
for i := 0 ; i < len (t .Attr ); i ++ {
209
209
if t .Attr [i ].Name .Local == "href" {
210
210
// Allocate more capacity.
211
- if altoCounter == cap (fileNames ) {
211
+ if ocrCounter == cap (fileNames ) {
212
212
newFileNames := make ([]string , 2 * cap (fileNames ))
213
213
copy (newFileNames , fileNames )
214
214
fileNames = newFileNames
215
215
}
216
- fileNames [altoCounter ] = t .Attr [i ].Value
217
- altoCounter ++
216
+ fileNames [ocrCounter ] = t .Attr [i ].Value
217
+ ocrCounter ++
218
218
}
219
219
}
220
220
}
@@ -227,7 +227,7 @@ func getMetsOcrFileNames(metsReader io.Reader) []string {
227
227
}
228
228
}
229
229
230
- return fileNames
230
+ return fileNames [: ocrCounter ]
231
231
232
232
}
233
233
You can’t perform that action at this time.
0 commit comments