diff --git a/pathologic.module b/pathologic.module
index f1ede5f..b530952 100644
--- a/pathologic.module
+++ b/pathologic.module
@@ -223,8 +223,24 @@ function _pathologic_replace($matches) {
     return $matches[0];
   }
 
-  // First, "files:" support. This is fairly easy.
-  if (isset($parts['scheme']) && $parts['scheme'] === 'files') {
+  // Okay, now we try to deal with paths to files. We detect if this is a path
+  // to a file if it has a scheme of "files" (Path Filter-style), or if, when
+  // we run it through realpath(), we get a path to a file which actually
+  // exists. If so, we try to create a URL using file_create_url(). This is
+  // all kind of iffy… if we end up using a file_create_url() path, that path
+  // won't have transformations done on it by Pathologic, such as conversion
+  // to a protocol-relative URL. Possible fix: Implement hook_file_url_alter()?
+  // @see file_create_url()
+  // @see hook_file_url_alter()
+  // @see [#1672430]
+  if (
+    // If we have a scheme of "files"…
+    (isset($parts['scheme']) && $parts['scheme'] === 'files')
+    // or of this seems to be a path to a file which really exists… (Note that
+    // file_exists() returns TRUE for directories, which is not desired
+    // behavior; hence is_file() below) 
+    || is_file(realpath($parts['path']))
+  ) {
     // Can we create a file URL for it?
     $file_url = file_create_url(file_build_uri($parts['path']));
     if ($file_url) {
@@ -235,12 +251,6 @@ function _pathologic_replace($matches) {
       return $matches[0];
     }
   }
-  elseif (file_exists(realpath($parts['path']))) {
-    // Okay, they didn't use files:, but does it appear that the path is still
-    // to a real file on the disk? If so, we don't want to adjust for language.
-    // Also, skip all other tweaks.
-    $settings['langcode'] = LANGUAGE_NONE;
-  }
 
   // Examine the query part of the URL. Break it up and look through it; if it
   // has a value for "q", we want to use that as our trimmed path, and remove it
diff --git a/pathologic.test b/pathologic.test
index dcb8f03..3b5012a 100644
--- a/pathologic.test
+++ b/pathologic.test
@@ -168,6 +168,11 @@ class PathologicTestCase extends DrupalWebTestCase {
       t('Path Filter compatibility (files:)')
     );
     $this->assertEqual(
+      _pathologic_filter('<img src="misc/feed.png" />', $filter, NULL, LANGUAGE_NONE, NULL, NULL),
+      '<img src="' . file_create_url(file_build_uri('misc/feed.png')) . '" />',
+      t('Paths to existing files')
+    );
+    $this->assertEqual(
       _pathologic_filter('<a href="http://example.com/qux/foo"><img src="http://example.org/bar.jpeg" longdesc="/bananas/baz" /></a>', $filter, NULL, LANGUAGE_NONE, NULL, NULL),
       '<a href="' . url('foo', array('absolute' => TRUE)) . '"><img src="' . url('bar.jpeg', array('absolute' => TRUE)) . '" longdesc="' . url('baz', array('absolute' => TRUE)) . '" /></a>',
       t('"All base paths for this site" functionality')
