1.4.3 - viewer - JFIF association

*** Please report new bugs here! ***

Moderators: XnTriq, helmut, xnview, Dreamer

User avatar
user0
XnThusiast
Posts: 1689
Joined: Sat May 09, 2015 9:37 am

1.4.3 - viewer - JFIF association

Post by user0 »

XnViewMP 1.4.3 64bit
Windows11 (22H2), display resolution 3840x2160, win scaling 150%


Viewer
XnViewMP can read/write JFIF, but does not open it Viewer tab after association

To reproduce:
  1. associate JFIF with XnViewMP (if it is not in the list - manually navigate to xnviewmp.exe)
    - Start > Settings > Apps > Default apps OR
    - win+r, run ms-settings:defaultapps
    association_jfif.png
  2. double-click on image file in windows file explorer
    jfif.zip

Issue
XnViewMP opens:
- browser with last directory (default settings) OR
- empty tab - if untick 'Open browser at startup' in Settings


Registry
  • CHECK
    Lets associate few apps and check what keys windows creates in registry:
    • XnViewMP

      Code: Select all

      [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jfif\UserChoice]
      "ProgId"="Applications\\xnviewmp.exe"
      "Hash"="NnaYQb9xvlE="
      
    • ACDSee

      Code: Select all

      [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jfif\UserChoice]
      "ProgId"="ACDSee Ultimate 2023.jfif"
      "Hash"="3X0UKoU+PV8="
      
    • IrfanView

      Code: Select all

      [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jfif\UserChoice]
      "ProgId"="Applications\\i_view64.exe"
      "Hash"="yQZfQC1AkSM="
      
    • FastStone

      Code: Select all

      [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jfif\UserChoice]
      "ProgId"="Applications\\FSViewer.exe"
      "Hash"="C50oD/i4bt4="
      
    • MS Photos

      Code: Select all

      [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jfif\UserChoice]
      "ProgId"="AppX43hnxtbyyps62jhe9sqpdzxn1790zetc"
      "Hash"="8hhFU2I6cJ4="
      
    ProgId references key in \Software\Classes\ either in HKCU or KHLM hives, eg:
    HKEY_CURRENT_USER\Software\Classes\Applications\xnviewmp.exe
    that does not exist in case of xnview for some reason
  • FIX
    Few assumptions:
    - xnviewmp located at D:\PROG\portable\graphic\XnViewMP\xnviewmp.exe
    - use HKEY_CURRENT_USER reg hive, not HKEY_LOCAL_MACHINE
    - it may be required to restart explorer.exe or reassociate via win settings once reg keys are added

    Association can be done in several ways
    • CASE A - Applications\xnviewmp.exe
      It looks like there is no Applications\xnviewmp.exe key that windows refers above.
      • lets create it:

        Code: Select all

        [HKEY_CURRENT_USER\Software\Classes\Applications\xnviewmp.exe\shell\open\command]
        @="\"D:\\PROG\\portable\\graphic\\XnViewMP\\xnviewmp.exe\" \"%1\""
        HKCU_xnviewmp_jfif_Applications.zip
    • CASE B - XnViewMP.jfif
      there are XnViewMP.xxx keys created (guess when you run xnviewmp with admin rights and maybe press assosiate in Settings), but no XnViewMP.jfif key.
      • lets create it:

        Code: Select all

        [HKEY_CURRENT_USER\Software\Classes\XnViewMP.jfif]
        @="JFIF Bitmap file"
        
        [HKEY_CURRENT_USER\Software\Classes\XnViewMP.jfif\DefaultIcon]
        @="D:/PROG/portable/graphic/XnViewMP/FileIcons/jpg.ico"
        
        [HKEY_CURRENT_USER\Software\Classes\XnViewMP.jfif\shell]
        
        [HKEY_CURRENT_USER\Software\Classes\XnViewMP.jfif\shell\open]
        
        [HKEY_CURRENT_USER\Software\Classes\XnViewMP.jfif\shell\open\command]
        @="\"D:\\PROG\\portable\\graphic\\XnViewMP\\xnviewmp.exe\" \"%1\""
        
        Note: file will have .jpg icon as there is no .jfif icon in xnview directory
      • also lets create reference to this new key in:

        Code: Select all

        [HKEY_CURRENT_USER\Software\Classes\.jfif\OpenWithProgids]
        "XnViewMP.jfif"=hex(0):
        HKCU_xnviewmp_jfif_XnViewMP.jfif.zip
      ProgId in ..Explorer\FileExts\.jfif\UserChoice will change to XnViewMP.jfif as well, automatically or after manuall reassociation (too lazy to check it).
    Now JFIF opens as expected.

Not sure who is not messing with registry enough (windows or xnview), but all other apps mentioned here have no association issues :D

ps. some stuff from 2014
How to change default mode to open to view, not browser

pps. how to set assosiation via SetUserFTA
You do not have the required permissions to view the files attached to this post.
Last edited by user0 on Mon Jun 26, 2023 5:05 pm, edited 12 times in total.
User avatar
xnview
Author of XnView
Posts: 43988
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: 1.4.3 - viewer - JFIF association

Post by xnview »

i don't know why Windows doesn't add correct keys in registry...
Pierre.
FKCapitalism2
Posts: 250
Joined: Sun Apr 23, 2023 5:14 am

Re: 1.4.3 - viewer - JFIF association

Post by FKCapitalism2 »

With portable version of XnViewMP i did not even have key "HKEY_CURRENT_USER\SOFTWARE\Classes\Applications\xnviewmp.exe". Solution "A" fixed my problem described here.