1.4.3 - settings - integration - file association JFIF

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

Moderators: XnTriq, helmut, xnview, Dreamer

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

1.4.3 - settings - integration - file association JFIF

Post by user0 »

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


Settings - Integration
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
    - 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:
    • Approach A - Applications\xnviewmp.exe
      via single app reference (no custom icons/localized file descriptions) for all required formats
      • 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

    • Approach B - XnViewMP.jfif
      via separate XnViewMP.xxx keys (with custom icons/localized file descriptions) for all required formats

      I assume XnViewMP creates these keys when "Set file associations..." pressed in Settings (require admin rights),
      unfortunately no XnViewMP.jfif key iscreated.
      • 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 Wed Jul 31, 2024 7:51 pm, edited 13 times in total.
User avatar
xnview
Author of XnView
Posts: 44572
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: 270
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.