Increased file contrast weirdness

I’m sharing this in case someone else experiences similar strangeness.

I’m making annotation files for documents, both typewritten and handwritten. I came upon a very faded handwritten document that I couldn’t read so I exported it and uploaded it to a website that offers free increased contrast for pdf files. Worked like a charm.

The trouble started when I then imported the file to DT, as it appears the file had some extras that it didn’t have before the contrast was increased. Specifically:

REV. J. M. CORMACK

Merwtsk CTIEAII CIIA

J.fcoiMACL

/+2,1? f."

That garbage became the annotation file - one that I had to delete. I figured I had the problem solved. Until I created an annotation file for the pdf and tried to insert a backlink. I got this:

x-DEVONthink-item://7FF4BB49-336B-4EA4-A60D-0FAEED9256A8?page=0

instead of the normal blue link that reads “Page 1”.

Going forward, when I encounter a very faded and almost unreadable document, I will export it, run it through a contrast enhancer website or program and then make the annotation file to attach to the original. I don’t know what is going on here, but clearly DT does not like files that have had their contrast increased in a way that adds garbage to the file. Perhaps there are websites and/or programs that don’t add this garbage to the file but I don’t know of them.

The contrast-enhanced PDF likely acquired or triggered a faulty OCR/text layer. Handwriting recognition quality can vary quit a bit. DEVONthink then indexed or used that poorly-recognized text when creating the annotation file. OCR engines are often poor at handwriting recognition and may generate nonsense characters. The raw DEVONthink URL appearing instead of a formatted “Page 1” link may reflect a formatting/annotation-file issue rather than the contrast enhancement itself.

1 Like

A one page document will not read page=1. The page count is zero-based, so the first page is page=0.

Bluefrog:

Well, then, what is this?

Hand drawn map of the lands owned by Charley A. Williams in 10-57-39. Biscayne Dr. is shown as “Beach Rd.” Page 1

In over 4,000 annotation files, I’ve never seen a “Page=0”.

Your link isn’t shown in its raw form, but when you look at it it’s exactly what I said…

 [Page 1](x-devonthink-item://9A9CBC9F-A5C1-4EA7-A14F-9FB73F1B5704?page=0)

Look at the link, not the link text. They’re two different things. The link text could be any arbitrary thing, like [happy jumping baby goats] but the link would still say page=0 for the first page of a PDF document.

1 Like

korm:

Thank you for your very reasonable explanation of what might be happening. I guess what I should do is to not try to OCR handwritten documents. I’ll have to leave them as jpg files. Prior to running OCR on a batch of files, I’ll have to mark the ones that are hand-written and leave them out of the batch. Again, thanks for the tip!

Bluefrog:

I’m not in the habit of looking at links - I’m only concerned that there is a link so that, if needed, I can look at the original document if the Gemini generated annotation file does not make sense.

How do I look at the link?

You just posted it, likely by pasting it into your response.
If you’re using rich text annotation files, only the link text will show. And there’s no real reason to look at the link for a one page document. DEVONthink knows what it’s doing when it creates item links.

Ah, yes, but unlike every other one of the 4,000+ text annotation files I’ve created, mostly with Gemini, this one does not show the link text. It shows the link instead, which is not clickable. I totally agree with you that DT knows what it is doing. This is the only document in a group of 76 files that is behaving this way.

Just as an experiment, after reading korm’s thoughts, I tried following what he suggested: leaving the jpg file alone. It made no difference. When I opened a backup copy of DT to export the file to Finder and then closed that backup database and opened the current one and imported the file, the corrupt annotation file came as part of the package. I then tried the same sequence of steps with a typewritten file in the same group and got the same result - a corrupted annotation file attached to the imported file. So while korm may well be correct in his assessment of the issue, that doesn’t seem to be playing out in this particular instance. It’s almost as if the database has flagged this particular file to behave differently than any of its 75 “siblings.'” I don’t know anything about databases but something is not quite right here.

Tomorrow, I will create text docs for all the other typewritten letters in this group with Gemini and see how that goes. I suspect all will go well - I had no issue at all until a few days ago with this process.

I’ve tried shutting down DT and also re-booting. That made no difference, either. I’m out of ideas.

Not necessarily a root cause, but I see no harm in rebuilding the database. Prophylactic, if nothing else.

It sounds like this file might not be a rich text file (from your earlier chat it sounded like your other annotation files might be). It sounds like it might be a markdown/plain text file and that’s why it’s behaving differently (plain text won’t make a hyperlink for you).

You can post a screengrab for us to confirm if you’re not sure, but if that’s the issue you’ll see that the kind is different in the Inspector.

MsLogica:

Thank you for your thoughts. The hyperlink appears if I hit “Enter” but I can’t check if it works because the document is only one page. If I leave that file and then come back to it, the hyperlink is gone and I have to hit “Enter” again to see it. What is even more interesting is that the annotation file is 12 point to start with. I enlarge it to 18 point so that it is easier to read, click on another file and then come back to find that the annotation file has reverted to 12 point. This is a very rare occurrence but it sure is weird!! I filed a bug report but this may not be of enough importance to investigate.

MsLogica,

I just noticed, in another occurrence of this weirdness, that you are correct - the annotation file is Kind = plain text. Every other annotation file I have created (thousands of them) is rich text.

I finally got both problems fixed but it involved having to copy the annotation file, delete the file from the database, reimport it and then paste the annotation file once again. I have not the slightest idea how this particular file came to be a plain text file. Plain text is a sure-fire way to a severe headache!

Thanks!