File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1010use File ;
1111use Intervention \Image \ImageManagerStatic as Image ;
1212use Validator ;
13+ use Illuminate \Support \Str ;
1314
1415class Resizer
1516{
@@ -690,11 +691,8 @@ private function detectFormat(bool $useNewFormat = false): array
690691 if ($ useNewFormat && !empty ($ this ->options ['format ' ]) && ($ this ->options ['format ' ] !== 'auto ' )) {
691692 $ format = $ this ->options ['format ' ];
692693 } else {
693- // Get the image resource entity if not already loaded
694- $ this ->initResource ();
695-
696- // Get format from image
697- $ format = strtolower (explode ('/ ' , $ this ->original ->mime ())[1 ]);
694+ $ format = File::mimeType ($ this ->getImagePath ());
695+ $ format = Str::after ($ format , '/ ' );
698696 }
699697
700698 // For the most part, the mime is the format: image/{format}
Original file line number Diff line number Diff line change 40402.1.7 :
4141 - Fix - Update plugin's boot method to not directly reference Settings until DB connection is established
42422.1.8 :
43- - Added twig filter to parse and resize/modify images (via regex) using twig filter(s)
43+ - Added twig filter to parse and resize/modify images (via regex) using twig filter(s)
44+ 2.1.9 :
45+ - Improvement to the detection of the original image's mime type (uses less system resources)
You can’t perform that action at this time.
0 commit comments