$crop = true;
}
+ // Debug log (convert crop to int to have TRUE being displayed as 1 and FALSE as 0)
+ common_debug('[' . __METHOD__ . ':' . __LINE__ . ']: width=' . $width . ',height=' . $height . ',crop=' . intval($crop));
+
// Get proper aspect ratio width and height before lookup
// We have to do it through an ImageFile object because of orientation etc.
- // Only other solution would've been to rotate + rewrite uploaded files.
+ // Only other solution would've been to rotate + rewrite uploaded files
+ // which we don't want to do because we like original, untouched data!
list($width, $height, $x, $y, $w, $h) =
$image->scaleToFit($width, $height, $crop);
return $out_url;
}
- function saveNew($data, $file_id, $url) {
+ function saveNew(array $data, $file_id, $url) {
$file_redir = new File_redirection;
+ $file_redir->urlhash = File::hashurl($short_url);
$file_redir->url = $url;
$file_redir->file_id = $file_id;
$file_redir->redirections = intval($data['redirects']);
public $__table = 'video'; // table name
public $id; // char (36) // UUID
- public $uri; // varchar (255) // This is the corresponding notice's uri.
- public $url; // varchar (255)
+ public $uri; // varchar (191) This is the corresponding notice's uri. not 255 because utf8mb4 takes more space
+ public $url; // varchar (191) not 255 because utf8mb4 takes more space
public $profile_id; // int
- public static function getByNotice($notice)
+ public static function getByNotice(Notice $notice)
{
return self::getKV('uri', $notice->uri);
}