This repository was archived by the owner on Nov 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -422,6 +422,37 @@ function getResolutions($config)
422422 return $ resolutions ;
423423 }
424424
425+ /**
426+ * @param $thumb
427+ * @param $resolutions
428+ *
429+ * @return string
430+ */
431+ function resolutionErrors ($ thumb , $ resolutions )
432+ {
433+ $ thumbCount = count ($ thumb );
434+ $ resCount = count ($ resolutions );
435+ // if the resolutions are more than the thumbnails remove the resolutions to match the thumbnail array
436+ if ($ resCount > $ thumbCount ) {
437+ // $resError = 'You Have More Resolutions Set In Your Config Than You Have Thumbnails Being Generated.';
438+ // $resError .= ' Add More Resolutions Or Remove A Width Or Height To Remove This Warning';
439+ $ newResArray = array_slice ($ resolutions , 0 , $ thumbCount );
440+ $ resError = array_combine ($ thumb , $ newResArray );
441+ }
442+ // if the resolution count is smaller than the number of thumbnails remove the number of thumbnails
443+ // to match the $resCount Array
444+ if ($ resCount < $ thumbCount ) {
445+ // $resError = 'You Have More Thumbnails Being Generated Than You Have Resolutions Set.';
446+ // $resError .= ' Add More Resolutions Or Remove A Width Or Height To Remove This Warning';
447+ $ newThumbArray = array_slice ($ thumb , 0 , $ resCount );
448+ $ resError = array_combine ($ newThumbArray , $ resolutions );
449+ }
450+ if ($ resCount === $ thumbCount ) {
451+ $ resError = array_combine ( $ thumb , $ resolutions );
452+ }
453+ return $ resError ;
454+ }
455+
425456 /**
426457 * @param $config
427458 *
You can’t perform that action at this time.
0 commit comments