File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ module.exports = function (gm) {
1212
1313 const IDENTIFYING = 1 ;
1414 const IDENTIFIED = 2 ;
15+
16+ /**
17+ * calculated formats https://imagemagick.org/script/escape.php
18+ * @type {RegExp }
19+ */
20+ const CALCULATED_FORMATS = / % k | % @ | % # /
1521
1622 /**
1723 * Map getter functions to output names.
@@ -270,6 +276,10 @@ module.exports = function (gm) {
270276 'identify'
271277 , '-ping'
272278 ] ;
279+
280+ if ( ! isFormatCalculated ( val . format ) ) {
281+ args . push ( '-ping' )
282+ }
273283
274284 if ( val . format ) {
275285 args . push ( '-format' , val . format ) ;
@@ -282,6 +292,14 @@ module.exports = function (gm) {
282292 args = args . concat ( self . src ( ) ) ;
283293 return args ;
284294 }
295+
296+ /**
297+ * @param {string|undefined } format
298+ * @returns {boolean }
299+ */
300+ function isFormatCalculated ( format ) {
301+ return ! format || ! ! CALCULATED_FORMATS . test ( format ) ;
302+ }
285303
286304 /**
287305 * Map exif orientation codes to orientation names.
You can’t perform that action at this time.
0 commit comments