Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
1e8ecbf2
Commit
1e8ecbf2
authored
May 14, 2021
by
Volker Krause
Browse files
Expose barcode search without aspect ratio heuristics to JS
parent
e3ad226a
Pipeline
#61949
passed with stages
in 12 minutes and 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/jsapi/barcode.cpp
View file @
1e8ecbf2
...
...
@@ -89,6 +89,15 @@ QString JsApi::Barcode::decodeDataMatrix(const QVariant &img) const
return
{};
}
QString
JsApi
::
Barcode
::
decodeAnyBarcode
(
const
QVariant
&
img
)
const
{
if
(
img
.
userType
()
==
qMetaTypeId
<
PdfImage
>
())
{
const
auto
pdfImg
=
img
.
value
<
PdfImage
>
();
return
m_decoder
->
decodeString
(
pdfImg
.
image
(),
BarcodeDecoder
::
Any
|
BarcodeDecoder
::
IgnoreAspectRatio
);
}
return
{};
}
QVariant
JsApi
::
Barcode
::
decodeUic9183
(
const
QVariant
&
s
)
const
{
Uic9183Parser
p
;
...
...
src/lib/jsapi/barcode.h
View file @
1e8ecbf2
...
...
@@ -41,6 +41,12 @@ public:
* @param img An image containing the barcode, e.g. a PdfImage instance.
*/
Q_INVOKABLE
QString
decodeDataMatrix
(
const
QVariant
&
img
)
const
;
/** Attempts to decode any barcode found in the given image.
* This is the most expensive of the above option, and should only be
* used if no other alternative is available.
* @param img An image containing the barcode, e.g. a PdfImage instance.
*/
Q_INVOKABLE
QString
decodeAnyBarcode
(
const
QVariant
&
img
)
const
;
/** Decode an UIC 918.3 message from a train ticket Aztec code.
* @param s A QByteArray containing the raw data from the barcode.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment