<?php
-list ($size, $imgpath) = explode('/', ltrim($Args, '/'), 2);
+if (!$User) return;
+list ($size, $imgpath) = explode('/', ltrim($Page->path, '/'), 2);
$imgpath = preg_replace('{^(?=[0-9]+/)}', 'data/', $imgpath, 1);
if (!file_exists($imgpath)) {
'-delete', '1--1', # static
'-trim',
'-background', 'white', '-layers', 'flatten', # opaque
+ '-auto-orient', # apply exif rotation
'-interlace', 'plane', # progressive
'-strip', '-taint', # omit metadata
'-sampling-factor', '4:2:0', '-colorspace', 'sRGB', # half chroma