implements querystring transformation #928

Merged
jessopb merged 1 commit from xformFileOnServe into master 2019-02-21 23:57:00 +01:00
jessopb commented 2019-02-20 07:34:43 +01:00 (Migrated from github.com)

querystrings containing h=#&w=# will scale the image.
querystrings containing an additional t=crop will crop to the center
system supports addition of more transformations responding to querystring vales as private functions inside transformImage.js

querystrings containing h=#&w=# will scale the image. querystrings containing an additional t=crop will crop to the center system supports addition of more transformations responding to querystring vales as private functions inside transformImage.js
skhameneh (Migrated from github.com) approved these changes 2019-02-20 19:17:41 +01:00
@ -7,0 +22,4 @@
let mediaType = fileType ? fileType.substr(0, fileType.indexOf('/')) : '';
const transform =
mediaType === 'image' && queryObject.hasOwnProperty('h') && queryObject.hasOwnProperty('w');
skhameneh (Migrated from github.com) commented 2019-02-20 19:15:33 +01:00

Can format like:

  const transform = (
    mediaType === 'image' && queryObject.hasOwnProperty('h') && queryObject.hasOwnProperty('w')
  );
Can format like: ``` const transform = ( mediaType === 'image' && queryObject.hasOwnProperty('h') && queryObject.hasOwnProperty('w') ); ```
skhameneh (Migrated from github.com) commented 2019-02-20 19:16:39 +01:00

Can use a destructuring assignment, see https://hacks.mozilla.org/2015/05/es6-in-depth-destructuring/

Can use a destructuring assignment, see https://hacks.mozilla.org/2015/05/es6-in-depth-destructuring/
skhameneh (Migrated from github.com) commented 2019-02-20 19:17:02 +01:00

Can use await

Can use `await`
jessopb commented 2019-02-21 08:02:11 +01:00 (Migrated from github.com)

@skhameneh Give it one more look, will ya? I modified the function to resize to match wordpress behavior, and added a stretch function.

@skhameneh Give it one more look, will ya? I modified the function to resize to match wordpress behavior, and added a stretch function.
jessopb (Migrated from github.com) reviewed 2019-02-21 08:03:01 +01:00
jessopb (Migrated from github.com) commented 2019-02-21 08:03:00 +01:00

I agree, but that's enough time spent on this feature for now.

I agree, but that's enough time spent on this feature for now.
skhameneh (Migrated from github.com) approved these changes 2019-02-21 23:29:44 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/spee.ch#928
No description provided.