<commit_before>diff --git a/src/FasterImage/FasterImage.php b/src/FasterImage/FasterImage.php
index c05c9d0..dd94cb8 100644
--- a/src/FasterImage/FasterImage.php
+++ b/src/FasterImage/FasterImage.php
@@ -122,9 +122,9 @@ class FasterImage
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_HEADER, 0);
         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
-        curl_setopt($ch, CURLOPT_BUFFERSIZE, 256);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
+        curl_setopt($ch, CURLOPT_BUFFERSIZE, 1024);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout);
         curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
diff --git a/src/FasterImage/ImageParser.php b/src/FasterImage/ImageParser.php
index 3b1dc3d..3e855dc 100644
--- a/src/FasterImage/ImageParser.php
+++ b/src/FasterImage/ImageParser.php
@@ -57,6 +57,8 @@ class ImageParser
                 return $this->parseSizeForPSD();
             case 'webp':
                 return $this->parseSizeForWebp();
+            case 'svg':
+                return $this->parseSizeForSvg();
         }

         return null;
@@ -133,7 +135,13 @@ class ImageParser
                 case "MM":
                     return $this->type = 'tiff';
                 default:
-                    return false;
+                    $this->stream->resetPointer();
+                    $markup = $this->stream->read( 1024 );
+                    if ( false !== strpos( $markup, '<svg' ) ) {
+                        $this->type = 'svg';
+                    } else {
+                        return false;
+                    }
             }
         }

@@ -345,6 +353,39 @@ class ImageParser

     }

+    /**
+     * Parse size for SVG.
+     *<commit_msg>Ensure FasterImage allows to set its user agent.<commit_after>diff --git a/src/FasterImage/FasterImage.php b/src/FasterImage/FasterImage.php
index c05c9d0..3a52402 100644
--- a/src/FasterImage/FasterImage.php
+++ b/src/FasterImage/FasterImage.php
@@ -32,6 +32,25 @@ class FasterImage
      */
     protected $includeContentLength = false;
 
+    /**
+     * The user agent to set for requests.
+     *
+     * @var string
+     */
+    protected $userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36';
+
+    /**
+     * Constructor.
+     *
+     * @param string $userAgent Optional. User agent to set for requests.
+     */
+    public function __construct($userAgent = '')
+    {
+        if ( ! empty( $userAgent ) ) {
+            $this->userAgent = $userAgent;
+        }
+    }
+
     /**
      * Get the size of each of the urls in a list
      *
@@ -122,15 +141,15 @@ class FasterImage
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_HEADER, 0);
         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
-        curl_setopt($ch, CURLOPT_BUFFERSIZE, 256);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
+        curl_setopt($ch, CURLOPT_BUFFERSIZE, 1024);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout);
         curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
 
         #  Some web servers require the useragent to be not a bot. So we are liars.
-        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36');
+        curl_setopt($ch, CURLOPT_USERAGENT, $this->userAgent);
         curl_setopt($ch, CURLOPT_HTTPHEADER, [
             "Accept: image/webp,image/*,*/*;q=0.8",
             "Cache-Control: max-age=0",
diff --git a/src/FasterImage/ImageParser.php b/src/FasterImage/ImageParser.php
index 3b1dc3d..3e855dc 100644
--- a/src/FasterImage/ImageParser.php
+++ b/src/FasterImage/ImageParser.php
@@ -57,6 +57,8 @@ class ImageParser
                 return $this->parseSizeForPSD();
             case 'webp':
                 return $this->parseSizeForWebp();
+            case 'svg':
+                return $this->parseSizeForSvg();
         }
 
         return null;
@@ -133,7 +135,13 @@ class ImageParser
                 case "MM":
                     return $this->type = 'tiff';
                 default:
-                    return false;
+                    $this->stream->resetPointer();
+                    $markup = $this->stream->read( 1024 );
+                    if ( false !== strpos( $markup, '<svg' ) ) {
+                        $this->type = 'svg';
+                    } else {
+                        return false;
+                    }
             }
         }
 
@@ -345,6 +353,39 @@ class ImageParser
 
     }
 
+    /**
+     * Parse size for SVG.
+     *
{'fraction_non_alphanumeric': 0.13930444919370508, 'fraction_numerical': 0.041383330095201086, 'mean_word_length': 2.012287887653599, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2110911', 'n_tokens_mistral': 1905, 'n_tokens_neox': 1688, 'n_words': 323}