How to default image to fit/fill when you upload in Filepond?

179 Views Asked by At

I'm using the filepond library in my Angular project and I was wondering if anybody knew if it was possible to set an image to fit/fill by default when a user uploads?

Im not very familiar with filepond and Pintura but I've looked through some documentation and didn't see anything about this.

1

There are 1 best solutions below

0
Flo On

I think a plugin can help: Image resize plugin

How to add plugins with angular-filepond?

import { FilePond, registerPlugin } from 'angular-filepond';
 
// Registering plugins
import FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type/dist/filepond-plugin-file-validate-type.esm';
registerPlugin(FilePondPluginFileValidateType);
 
// Adding FilePond to imports
@NgModule({
  imports: [
    FilePond
  ]
})
 
export class AppModule { }

Here are some infos from the plugins page:

The Image resize plugin automatically calculates and adds resize information.

The Image preview plugin uses this information to show the correct preview. The Image transform plugin uses this information to transform the image before uploading it to the server.

The picture shows some properties. imageResizeMode sounds useful I think.

enter image description here