Nightcrawler

Hmm, having some issues with the upload validator...created an extension:

  1. use SilverStripe\Assets\Upload_Validator;
  2. class ImageUploadValidator extends Upload_Validator { ... }

added it to .yml

  1. SilverStripe\Assets\Upload_Validator:
  2. extensions:
  3. - ImageUploadValidator

Called it on my page:

  1. function getCMSFields() {
  2. $fields = parent::getCMSFields();
  3. ...
  4. $validator = new ImageUploadValidator();
  5. $validator->setMinDimensions(500,500);
  6. $validator->setMaxDimensions(1400,1400);
  7. $validator->setAllowedMaxFileSize(2 * 1024 * 1024);
  8. $sortableUpload->setValidator($validator);
  9. return $fields;}

but SS4 throws me an error:

  1. [Warning] call_user_func() expects parameter 1 to be a valid callback, class 'ImageUploadValidator' does not have a method 'add_to_class'
  2.  
  3. Line 74 in testproject\vendor\silverstripe\framework\src\Core\Config\Middleware\ExtensionMiddleware.php
Nightcrawler

I might just end up allowing a max image dimension with a custom validator...

firesphere

Hmmm, I recognize that name from somewhere... but not the scaled uploads? I didn't even know that existed 😮

Nightcrawler

has anyone used axllent/silverstripe-scaled-uploads and knows if there's a way to preserve the image metadata?

firesphere

Yeah, but your right shoulder (which I meant originally, left as in left in the photo) looks like it completely blends in with what you're wearing and looks like it's sort of part of you 😄

heggsta

haha, didn't even notice!... I think I've got a person on each shoulder, upon closer inspection

firesphere

@heggsta your avatar is hilarious by the way, that one "head on your ~left~ right shoulder" 😄

heggsta

not a nail... a widget by the sounds of things 😉

 

[2019-03-22 08:21:22] manifestcache-log.WARNING: Failed to save values {"keys":["__CACHE__"],"exception":null} []