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
185185
186186// getMetsOcrFileNames creates the array of file names from the METS file.
187187func getMetsOcrFileNames (metsReader io.Reader ) []string {
188- var fileNames = make ([]string , 50 )
188+ var fileNames = make ([]string , 100 )
189189 parser := xml .NewDecoder (metsReader )
190190 ocrFileElement := false
191- altoCounter := 0
191+ ocrCounter := 0
192192 for {
193193 token , err := parser .Token ()
194194 if err != nil {
@@ -208,13 +208,13 @@ func getMetsOcrFileNames(metsReader io.Reader) []string {
208208 for i := 0 ; i < len (t .Attr ); i ++ {
209209 if t .Attr [i ].Name .Local == "href" {
210210 // Allocate more capacity.
211- if altoCounter == cap (fileNames ) {
211+ if ocrCounter == cap (fileNames ) {
212212 newFileNames := make ([]string , 2 * cap (fileNames ))
213213 copy (newFileNames , fileNames )
214214 fileNames = newFileNames
215215 }
216- fileNames [altoCounter ] = t .Attr [i ].Value
217- altoCounter ++
216+ fileNames [ocrCounter ] = t .Attr [i ].Value
217+ ocrCounter ++
218218 }
219219 }
220220 }
@@ -227,7 +227,7 @@ func getMetsOcrFileNames(metsReader io.Reader) []string {
227227 }
228228 }
229229
230- return fileNames
230+ return fileNames [: ocrCounter ]
231231
232232}
233233
You can’t perform that action at this time.
0 commit comments