Skip to content

Allow only "fit-in" modification with certain sizes for frontend API calls #509

Answered by simonkrol
valeriblack asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @valeriblack and @bensquire.

While this isn't officially supported, you could make the following changes to achieve similar functionality to what you're describing:

  1. Remove the option for if ( requestType == RequestTypes.DEFAULT) from /source/image-handler/image-request.ts:260-263
    This prevents the user from using anything other than Thumbor style requests (Keep in mind this will break the demo ui)
  2. Replace the entirety of the contents of mapPathToEdits function in source/image-handler/thumbor-mapper.ts:19-35 with
    let edits: ImageEdits = this.mapFitIn(path);
    return edits;

This will only parse for the fit in filter

  1. To handle only allowing certain sizes, you may be able to make…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by simonkrol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants