<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniel Veihelmann</title>
    <description>The latest articles on DEV Community by Daniel Veihelmann (@dan1ve).</description>
    <link>https://dev.to/dan1ve</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F109473%2F50cd0d3f-ab06-4cac-b628-3733a4d71593.jpeg</url>
      <title>DEV Community: Daniel Veihelmann</title>
      <link>https://dev.to/dan1ve</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dan1ve"/>
    <language>en</language>
    <item>
      <title>Running IrfanView on Ubuntu 22.10 using Wine</title>
      <dc:creator>Daniel Veihelmann</dc:creator>
      <pubDate>Fri, 24 Feb 2023 18:41:00 +0000</pubDate>
      <link>https://dev.to/dan1ve/running-irfanview-on-ubuntu-2210-using-wine-3n6g</link>
      <guid>https://dev.to/dan1ve/running-irfanview-on-ubuntu-2210-using-wine-3n6g</guid>
      <description>&lt;p&gt;I switched to Linux (Ubuntu 22.10) recently after using Windows for literally decades. While there are pros (like performance) and cons (like system stability) for this choice, I want to quickly describe one specific problem I faced, and how I solved it. Maybe this helps someone 😉&lt;/p&gt;

&lt;h2&gt;
  
  
  What is IrfanView?
&lt;/h2&gt;

&lt;p&gt;IrfanView &lt;a href="https://www.irfanview.com/" rel="noopener noreferrer"&gt;irfanview.com&lt;/a&gt; is one of the most popular image viewers there is. It is very quick and lightweight, but also has some pretty neat features to edit images quickly. While there is no native Linux support, it is possible to run IrfanView using Wine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem: Scaling issues with IranView using Snap and Ubuntu 22.10
&lt;/h2&gt;

&lt;p&gt;As it turned out, simply installing IrfanView using the &lt;a href="https://snapcraft.io/install/irfanview/ubuntu" rel="noopener noreferrer"&gt;Snap entry &lt;/a&gt; didn't work. &lt;/p&gt;

&lt;p&gt;The main problem was that the &lt;strong&gt;scaling of the system menu&lt;/strong&gt; on my 4K monitor didn't work, it was super tiny. Wine has an option to set a custom dpi value (via &lt;code&gt;winecfg&lt;/code&gt; under &lt;code&gt;Graphics&lt;/code&gt;), but this didn't affect IrfanView 😥&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution: Use Wine without Snap
&lt;/h2&gt;

&lt;p&gt;After a lot back and forth, I removed the snap version of IrfanView and tried Wine (stable) directly. This is as simply as downloading IrfanView's ZIP file and then running &lt;code&gt;i_view32.exe&lt;/code&gt; with the &lt;code&gt;Wine Windows Program Loader&lt;/code&gt; (via &lt;code&gt;Open With&lt;/code&gt;) or &lt;code&gt;wine i_view32.exe&lt;/code&gt; in the terminal.&lt;/p&gt;

&lt;p&gt;And to me amazement, this worked immediately. No more unreadable system menu bars 🎉&lt;/p&gt;

&lt;p&gt;There was only one more thing I wanted: It should be possible to &lt;strong&gt;open images directly with IrfanView&lt;/strong&gt; (e.g. via &lt;code&gt;Open With&lt;/code&gt; in the file browser).  &lt;/p&gt;

&lt;p&gt;To make a long story short, you need to do the following:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Create a &lt;code&gt;.desktop&lt;/code&gt; file
&lt;/h3&gt;

&lt;p&gt;Create a file &lt;code&gt;IrfanView.desktop&lt;/code&gt; in your &lt;code&gt;home&lt;/code&gt; folder. Don't forget to add the correct path instead of the two &lt;code&gt;TODO&lt;/code&gt;s!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Desktop Entry]
Name=IrfanView
Comment=Open Images with Irfanvieww
Keywords=image;
Exec=/usr/bin/env sh -c "winepath -w -0 %F | WINEPREFIX='/home/TODO: your user/.wine' xargs -0 wine /home/&amp;lt;TODO: YOUR PATH HERE&amp;gt;/irfanview/i_view32.exe"
Terminal=false
Type=Application
StartupNotify=true
MimeType=image/jpeg;image/png;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;Exec&lt;/code&gt; section passes the target file to wine (and irfanview), but also uses &lt;code&gt;winepath&lt;/code&gt; to transform the file path to a "Windows path" so that IrfanVIew understands it.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Register your application wrapper
&lt;/h3&gt;

&lt;p&gt;In your &lt;code&gt;home&lt;/code&gt; directory, run &lt;code&gt;sudo desktop-file-install IrfanView.desktop&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This validates the file you created, and adds it to the "Open With" applications.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>wine</category>
      <category>irfanview</category>
      <category>snap</category>
    </item>
  </channel>
</rss>
