This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mix = require('laravel-mix'); | |
const url = 'http://lab.tinypixel.test'; | |
const app = './src'; | |
const config = './config'; | |
const resources = './resources'; | |
const assets = './resources/assets'; | |
const dist = './dist'; | |
const externals = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// So ImageMagic is pretty cool, -but- it can sometimes consider a TIFF | |
// to be "metadata" that should be part of your thumbnailed JPG. | |
$Thumb = new \Imagick(); | |
$Thumb->setResolution(72,72); // set the DPI of $Thumb to 72dpi, it's the WEB! | |
$data = file_get_contents('/data/some_image.jpg'); // secretly a TIFF pretending to be a JPG | |
// else make $data be something that came from curl_exec | |
$Thumb->readImageBlob($data); | |
$Thumb->setCompressionQuality(80); // you know, why have a 100compression quality thumbnail? | |
$Thumb->resampleImage(72,72,imagick::FILTER_UNDEFINED,1); // VERY IMPORTANT, without this it'll just "set" the DPI |