Author Topic: Fix wrong images in previews  (Read 344 times)

neal

  • Jr. Member
  • *
  • Posts: 65
Fix wrong images in previews
« on: March 29, 2021, 01:15:37 PM »
This problem continues: many preview images are not the same as the selected image. Some other images from the DB come up as the preview. The fix is: control-update cache only in the rescan menu. Please figure out the cause and fix it.
Neal

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 28532
Re: Fix wrong images in previews
« Reply #1 on: March 29, 2021, 02:10:22 PM »
This is the board to post feature requests. Not for reporting bugs.
Please try to post in the correct board. Each board has a description, telling you what to post where.
I will move this post into the correct board this once (did also do that with your other post from this morning).

When filing a bug report, provide a minimum of info, like the log file, the type of files you are processing, your cache settings, if you use versioning with visual proxies etc.
Which Database options you use. Which indexing options you use.
Does this only happen in the Viewer or also in the Quick Preview Panel or the Slide Show?
Every option or bits of info may be important to analyze this.

I'm not aware of any other user currently reporting a similar problem. The cache file names are produced from the unique id (OID) of the image file in the database.
This means links between cache and image cannot break. If you see the wrong image for a file, the cache image must have been generated wrong. Not sure under which conditions this can happen.
Knowing more about your cache settings and indexing options will be helpful.

neal

  • Jr. Member
  • *
  • Posts: 65
Re: Fix wrong images in previews
« Reply #2 on: March 29, 2021, 02:25:44 PM »
update cache does not fix this as reported. Only (control>cache>rebuild) works.

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 28532
Re: Fix wrong images in previews
« Reply #3 on: March 29, 2021, 03:04:46 PM »
Please provide the info I have requested (see above) so I can further analyze this. I have no idea where to even start with this rather unique problem...
What is control > Cache > Rebuild?

neal

  • Jr. Member
  • *
  • Posts: 65
Re: Fix wrong images in previews
« Reply #4 on: March 30, 2021, 09:33:17 AM »
1. No versioning or visual proxies
2. Using jpgs, pdfs, a few eps and ai
3. Problem shows in both the quick view and viewer
4. Cache settings and database options are attached
5. Log files attached

This problem seems to be getting worse. There used to be about 10% wrong images. Now there is 30% or more. Only fix seems to be to right click on the problem folder and selecting  PURGE AND REBUILD CACHE DATA.


Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 28532
Re: Fix wrong images in previews
« Reply #5 on: March 30, 2021, 10:33:29 AM »
Hm. You have limited the maximum cache folder size to only 10 GB, but your cache folder is almost 60 GB. Purge is off so IMatch will delete older images from the cache all the time when new images come in. Maybe this is somehow related...

Dial in a much larger cache size, e.g. 200 GB and see if this solves the problem.
If this is the case, we might have a hint where to look for this problem.

neal

  • Jr. Member
  • *
  • Posts: 65
Re: Fix wrong images in previews
« Reply #6 on: March 30, 2021, 12:27:38 PM »
Done. Should I turn the purge on?

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 28532
Re: Fix wrong images in previews
« Reply #7 on: March 30, 2021, 01:09:52 PM »
No, this is off by default.
I've just accompanied me again with the workings of this (this code is unchanged for many years).
IMatch only removes files from the cache when "Purge" is on. It then uses the configured maximum size to determine how much to purge. Else the cache size is irrelevant.
I doubt that this is related to this problem you are experiencing.

You have configured IMatch to cache JPEG files. This option is normally set to off - because caching JPEG files basically means copying the original JPEG into the cache. This makes only sense when you work with off-line files and the JPEG files are not always available and hence you want to cache them explicitly.

Is this the case? If not, I recommend to set Don't cache JPEG files to On again. And then maybe purge the cache to remove the already cached JPEG files.

If you experience the problem with the wrong image, are all file formats affected or only JPEG files?

If this happens again, please perform the following step:

1. Select the file showing the wrong image in the Viewer in a File Window.
2. In the VarToy app, enter this expression:

{File.OID|cast:int}
{File.CacheFileName}

This shows the unique id of the file, and in the second line the cache file name on your disk.
a) Does the file name of the cache file match the file number?
b) If you open the cache file in an image editor, is the content wrong?

Tveloso

  • Full Member
  • **
  • Posts: 238
Re: Fix wrong images in previews
« Reply #8 on: March 30, 2021, 02:33:00 PM »
Could using multiple IMatch Databases, without having changed the Database ID, cause something like this?
--Tony

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 28532
Re: Fix wrong images in previews
« Reply #9 on: March 30, 2021, 02:50:56 PM »
Could using multiple IMatch Databases, without having changed the Database ID, cause something like this?

Definitely.

neal

  • Jr. Member
  • *
  • Posts: 65
Re: Fix wrong images in previews
« Reply #10 on: March 30, 2021, 03:26:44 PM »
Don't cache JPEG files to On "seems" to have fixed the problem. We'll see. How do I purge the cache?

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 28532
Re: Fix wrong images in previews
« Reply #11 on: March 30, 2021, 04:34:56 PM »
To purge the cache use the "Purge..." command from the context menu. Searching for the word purge in the IMatch help reveals: Selective Caching and Purging

Did you make the check for the id and cache file name I've asked for above?
« Last Edit: March 30, 2021, 04:44:02 PM by Mario »

neal

  • Jr. Member
  • *
  • Posts: 65
Re: Fix wrong images in previews
« Reply #12 on: March 31, 2021, 12:40:03 PM »
Before the purge, {File.OID|cast:int}{File.CacheFileName} said: some files said

93,602
C:\ProgramData\photools.com\IMatch6\previewcache\7B65D9EF-9DCF-401E-B34F-CB3905ABD16C\93\93602.jpg

After the purge:some files said 93602

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 28532
Re: Fix wrong images in previews
« Reply #13 on: March 31, 2021, 12:53:04 PM »
This looks correct. The name of the cache file matches the unique file id.
After purging the cache and removing the JPEG cache images, the cache file name for these files will be empty - because for JPEG files IMatch always uses the original file.

neal

  • Jr. Member
  • *
  • Posts: 65
Re: Fix wrong images in previews
« Reply #14 on: March 31, 2021, 01:28:25 PM »
Good. Hope everything stays alright. Thanks so much!

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 28532
Re: Fix wrong images in previews
« Reply #15 on: March 31, 2021, 01:45:07 PM »
I'm happy that is working for you again.

But I still wonder what the problem was. Last night I've created a new database from 30,000 JPEG files, enforcing caches for the JPEG files.
While IMatch was indexing I used the Viewer and Quick View Panel, I closed and re-opened the database to make it stop and restart the indexing etc.
I then used an app to check all images and their cache files. Not a single problem, they always matched (cache file name and visual).
So this appears not to be a principle problem, but somehow being caused by a combination of settings, images, database and whatnot...