Open acdoll opened 7 months ago
more difficult problem than I would have expected
Yes it is.
something Arctos wants to be responsible for
Not really, the normal pathway (installing some java-bits) it would mean a more complicated recipe for building servers and some security stuff to worry about (and the thing that many of those libraries use had a HUGE incident kinda-recently). That's definitely not "no" but it would be enough of a sustainability impact that I think we'd need to discuss with The Community and TACC.
I googled 'barcode api' or something of the sort, that lead me to https://barcodeapi.org/index.html, I built https://arctos-test.tacc.utexas.edu/Reports/reporter.cfm?action=edit&report_id=191 --> https://arctos-test.tacc.utexas.edu/Reports/reporter.cfm?action=view&report_id=191&table_name=whatever - not a clue if they want $$ at some level or if that's still there or anything else, but I was able to make my browser display something that sorta looks like a barcode in a couple minutes....
Awesome - that looks really promising! So i just need to get the part barcode to feed into that url and then place that output image into my label. That sounds do-able; I'll give it a try. Thanks D.
What kind of barcode are you generating? We generate our series in Excel using base10to base36 conversion formula to make a barcode that will fit on top of a cryovial. I've been having these printed at EIM, but looking into using our datamatrix printer.
We're looking to print data matrix barcodes. They can print pretty small and are still readable by our scanners. They also can contain a lot of information; its not that we need that now, but want capacity for that in the future. After getting a little help on this, it seems like integrating that API call is going to work. @dustymc Can you help me with some SQL to pull the barcode for a specific part, e.g., skeleton? Seems like we need to first grab the collection_object_id from the specimen_part table, but I don't see how to then grab the barcode (from the container table?).
@acdoll I need
I've added
to the r1 divOops; i added:
Oops; i added:
Whoa, that's way nicer than the mess I was making, thanks!
I can work this into your label if you want me to, but I think maybe a standalone template-thingee is more useful for all of us. (Or: that's pretty complex code, I don't wanna muck it up!)
https://arctos.database.museum/Reports/reporter.cfm?action=edit&report_id=197
Let me know if you want me to do something else.
@dustymc this is great - thank you!! I've been struggling to find time to work on this, but I'll let you know how it goes.
I think I've got this working pretty well:
This is really great -is it shareable? What do you encode in the part barcode - the DZTB number?
I think this is resolved.
@dustymc - I had to set this aside for a while, but now I'm trying again and the barcode images are not displaying properly. From my report they print out fuzzy and rectangular (not square). From your report (197), they seem crisp enough, but they are also rectangular. Could this be affected by the addition of the Report PDF Parameters options that were added?
fuzzy
I wonder if they're reducing quality after so many calls or something?? I don't see anything like that - got a sample?
rectangular
That's just how datamatrix barcodes work see eg https://barcodeapi.org/api/dm/DMNSZT9C1VH
affected by the addition of the Report PDF Parameters
No, unless you're using them to generate PDF serverside (which could explain the fuzzy....).
I haven't been using this and am only testing with small sets, so they shouldn't have caught on to this yet. I think I know why I'm getting rectangles. These skeleton barcodes had an extra digit as compared to the tissue sample barcodes I was using for testing. That generator site seems to have specific character limits that make it switch between square and rectangle. I found another site that does the same thing https://orcascan.com/guides/free-barcode-image-api-0e4a4fa6 and these still turn out as squares.
It seems like the fuzziness was the result of me trying to force the size and thus tweeking the image resolution.
I'm now having an issue with it not displaying barcodes that should be there. I'm looking at: Query: https://arctos.database.museum/search.cfm?guid=DMNS%3ABird%3A47782%20DMNS%3ABird%3A49144%20DMNS%3ABird%3A50625%20DMNS%3ABird%3A51207%20DMNS%3ABird%3A51393%20DMNS%3ABird%3A51967%20DMNS%3ABird%3A53615%20DMNS%3ABird%3A54519%20DMNS%3ABird%3A54638 Report: TEST_DMNS_skeleton box label
Each of these has a skeleton and each skeleton has a barcode. However, when I look at the JSON Part on the results page several of them do not have the barcode listed in the part_barcode field: Any idea on what's going on here?
Hu!
https://barcode.orcascan.com/?type=datamatrix&data=HelloHelloHello https://barcodeapi.org/api/dm/HelloHelloHello
are different shapes, and https://barcode.orcascan.com/?type=datamatrix&data=HelloHelloHelloHelloHelloHello just keeps getting bigger, and https://barcodeapi.org/api/dm/HelloHelloHelloHelloHelloHello went back to square - and my phone can still understand both of them....
Hu!
do not have the barcode listed
The cache probably got out of whack. You can request a refresh, and please file an issue if you've got any idea how that might have happened (or if you don't, but I'm not sure how much luck I'll have going in blind - I suspect it's something involving the part/container/barcode link, and there are a LOT of ways to make that connection.)
I like the square ones for aesthetics but as long as they scan properly and I can fit them on my labels, I guess it doesn't really matter.
As for the cache, do I have to request a refresh on each record that is behaving weird? We just loaded 50 of these barcodes yesterday, using Bulk Parts-->Containers, to test this out.
I do not seem to have permissions to request this refresh:
Some of these still don't seem to be updated; some skeleton barcodes are still not displaying on the report or in the JSON Parts
permissions
Try again. (I'm guessing you logged out, or your cache got reclaimed - big gap between the actions or a glitch in the matrix.)
Still getting the same error on the refresh attempt.
Thanks, I see the problem now. It might take me a while to address it, send me your search URL (please include guid_prefix) and I'll request the refresh for you.
done
I've been wondering if we could print barcodes right out of Arctos for our labels and reports (e.g., https://arctos.database.museum/Reports/reporter.cfm?action=edit&report_id=57, https://arctos.database.museum/Reports/reporter.cfm?action=edit&report_id=190). It seems like this is a more difficult problem than I would have expected. The most common solution I have found is something like 'generate images server side to generate the bar codes' and then insert the png into your html. I don't imagine that is something Arctos wants to be responsible for (or is it?). Anyway, I stumbled upon this GitHub: https://github.com/zingl/2D-Barcode/blob/master/barcode.html and am wondering if there is something useful in there for maybe making this work. It appears (?) to utilize another webpage (http://www.w3.org/2000/svg) to encode the text, but that page appears to be retired.
I've been shooting for using data matrix barcodes because they can be printed pretty small and still be readable by our scanners. If there is a more simple solution to get 1d barcodes, that would probably work fine for most of our needs. I would appreciate any suggestions or advice.