Copy original file if pngquant can't compress it.

--skip_if_larger does nothing and returns an error if pngquant would
generate a larger file than the original.  Formerly we would not copy
the file in this case so later operations expecting the file would fail.
No image triggered this, though, so the issue went unnoticed.  We want
the smaller of the two files.  It's unclear if later compression using
optipng would still do better with the larger quantized file vs the
original unquantized file, but we need to have a file.
This commit is contained in:
Doug Felt 2017-01-25 09:16:47 -08:00
parent 11868c62b7
commit 494fb41a68

View file

@ -168,10 +168,10 @@ flag-symlinks: $(RESIZED_FLAG_FILES) | $(RENAMED_FLAGS_DIR)
$(RENAMED_FLAG_FILES): | flag-symlinks
$(QUANTIZED_DIR)/%.png: $(RENAMED_FLAGS_DIR)/%.png $(PNGQUANT) | $(QUANTIZED_DIR)
$(PNGQUANT) $(PNGQUANTFLAGS) -o "$@" "$<"
@($(PNGQUANT) $(PNGQUANTFLAGS) -o "$@" "$<"; case "$$?" in "98") cp $< $@;; *) exit "$$?";; esac)
$(QUANTIZED_DIR)/%.png: $(EMOJI_DIR)/%.png $(PNGQUANT) | $(QUANTIZED_DIR)
$(PNGQUANT) $(PNGQUANTFLAGS) -o "$@" "$<"
@($(PNGQUANT) $(PNGQUANTFLAGS) -o "$@" "$<"; case "$$?" in "98") cp $< $@;; *) exit "$$?";; esac)
$(COMPRESSED_DIR)/%.png: $(QUANTIZED_DIR)/%.png | check_compress_tool $(COMPRESSED_DIR)
ifdef MISSING_ZOPFLI