![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Perform OCR recognition on multiple images.
Note that this doesn't currently contain a normal functioning binary and needs adapting of source.
npm i -D ocr-bulk
(for development use) or npm i -P ocr-bulk
(for production use)For PDF conversion support:
brew install ghostscript
'use strict';
const {join} = require('path');
const ot = require('ocr-bulk');
(async () => {
await ot.writeFile({
start: 1,
end: 3,
outputPath: join(__dirname, 'ocr.txt'),
getImagePath (i) {
return `C:\\Users\\Brett\\Documents\\images\\image-${ot.pad(i, 4)}.jpg`;
},
concatenater (text, i) {
// eslint-disable-next-line no-console
console.log('Finishing ' + i);
return `\n\n{{page|${i}}}\n\n${text}`;
}
});
// eslint-disable-next-line no-console
console.log('Saved!');
})();
writeFile({start: ..., end: ..., getImagePath: cb(i), readErrback: cb(err), outputPath: ..., concatenater: cb(text, i), tesseractOptions: {}, done: cb()})
- This method will concatenate results based on the supplied arguments and output into a single file. Passed a single config object whose start
property indicates a number at which to begin reading images (defaults to 1
) and end
is a required ending number. getImagePath
is a required callback which is passed the current iteration number and should be used to return an image path. readErrback
is an optional errback which will be passed the file read error if one occurs. outputPath
is a required string indicating the desired path to which to write the concatenated contents. concatenater
is a callback which will be called with the OCR'd text and the current iteration count. It should return the value to be appended to any previously concatenated values (starting with an empty string). done
is an optional callback which will be called upon completion of appending OCR for all read files (those between the supplied start and end points); the Promise
returned from writeFile
can be used for the same purpose.readOCR({start: ..., end: ..., getImagePath: cb(i), readErrback: cb(err), processor: cb(text, i), tesseractOptions: {}, done: cb()})
- Passed a single config object whose start
property indicates a number at which to begin reading images (defaults to 1
) and end
is a required ending number. getImagePath
is a required callback which is passed the current iteration number and should be used to return an image path. readErrback
is an optional errback which will be passed the file read error if one occurs. processor
is a required callback argument which receives the current OCR'd text and the current iteration number as arguments. done
is an optional callback which will be called upon completion of reading all files between the supplied start and end points; the Promise
returned from writeFile
can be used for the same purpose.pad(val, len, chr)
- A utility intended for use by getImagePath
to add padding in retrieval of predictable image path inputs. The required val
is the value to be padded, the required len
indicates the desired total length including padding, and chr
is an optional character to be used for padding (defaults to "0").FAQs
Perform OCR recognition on multiple images
We found that ocr-bulk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.