diff --git src/wp-includes/functions.php src/wp-includes/functions.php
index ee214e9..966dcd8 100644
--- src/wp-includes/functions.php
+++ src/wp-includes/functions.php
@@ -2367,7 +2367,8 @@ function wp_get_image_mime( $file ) {
 	 */
 	try {
 		if ( is_callable( 'exif_imagetype' ) ) {
-			$mime = image_type_to_mime_type( exif_imagetype( $file ) );
+			$imagetype = exif_imagetype( $file );
+			$mime = ( $imagetype ) ? image_type_to_mime_type( $imagetype ) : false;
 		} elseif ( function_exists( 'getimagesize' ) ) {
 			$imagesize = getimagesize( $file );
 			$mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false;
diff --git tests/phpunit/tests/functions/wpGetImageMime.php tests/phpunit/tests/functions/wpGetImageMime.php
new file mode 100644
index 0000000..dcb4b63
--- /dev/null
+++ tests/phpunit/tests/functions/wpGetImageMime.php
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * Tests for wp_get_image_mime()
+ *
+ * @group functions.php
+ * @ticket 40017
+ */
+class Tests_Functions_Wp_Get_Image_Mime extends WP_UnitTestCase {
+	function setUp() {
+		if ( ! is_callable( 'exif_imagetype' ) && ! function_exists( 'getimagesize' ) )
+			$this->markTestSkipped( 'The exif PHP extension is not loaded.' );
+		parent::setUp();
+	}
+
+	public function test_wp_get_image_mime() {
+		// Test a valid image.
+		$out = wp_get_image_mime( DIR_TESTDATA.'/images/2004-07-22-DSC_0008.jpg' );
+		$this->assertEquals( 'image/jpeg', $out );
+
+		// Test a non-image file.
+		$out = wp_get_image_mime( DIR_TESTDATA.'/uploads/dashicons.woff' );
+		$this->assertEquals( false, $out );
+	}
+}
