You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it posible to use strapi-plugin-image-optimizer along strapi-provider-cloudflare-r2 ?
I can use both separatelly but togetter they don't work. Any ideas?
Thanks in advice!
// plugin.ts configurationexportdefault({ env })=>({"drag-drop-content-types": {enabled: true,},"image-optimizer": {enabled: false,config: {include: ["jpeg","jpg","png","tiff","webp","avif","gif"],// exclude: ["gif"],formats: ["webp"],sizes: [{name: "sm",width: 480,withoutEnlargement: true,},{name: "md",width: 960,withoutEnlargement: true,},{name: "xl",width: 1920,// withoutEnlargement: true,},{// Uses original size but still transforms for formatsname: "original",},],additionalResolutions: [],quality: 90,},},upload: {config: {sizeLimit: 2097152,// 2MB in bytesmimeTypes: ["image/jpeg","image/png","image/gif","image/webp","image/avif",],provider: "strapi-provider-cloudflare-r2",providerOptions: {accessKeyId: env("CF_ACCESS_KEY_ID"),secretAccessKey: env("CF_ACCESS_SECRET"),endpoint: env("CF_ENDPOINT"),params: {Bucket: env("CF_BUCKET"),},/** * Set this Option to store the CDN URL of your files and not the R2 endpoint URL in your DB. * Can be used in Cloudflare R2 with Domain-Access or Public URL: https://pub-<YOUR_PULIC_BUCKET_ID>.r2.dev * This option is required to upload files larger than 5MB, and is highly recommended to be set. * Check the cloudflare docs for the setup: https://developers.cloudflare.com/r2/data-access/public-buckets/#enable-public-access-for-your-bucket */// cloudflarePublicAccessUrl: env("CF_PUBLIC_ACCESS_URL"),/** * Sets if all assets should be uploaded in the root dir regardless the strapi folder. * It is useful because strapi sets folder names with numbers, not by user's input folder name * By default it is false */pool: false,},actionOptions: {upload: {},uploadStream: {},delete: {},},},},});```
The text was updated successfully, but these errors were encountered:
It actually works with config like that:
/config/plugins.ts
import{ConfigasImageOptimizerConfig}from'strapi-plugin-image-optimizer/dist/server/models/config';exportdefault({ env })=>({upload: {config: {provider: 'strapi-provider-cloudflare-r2',providerOptions: {accessKeyId: env('CF_ACCESS_KEY_ID'),secretAccessKey: env('CF_ACCESS_SECRET'),/** * `https://<ACCOUNT_ID>.r2.cloudflarestorage.com` */endpoint: env('CF_ENDPOINT'),params: {Bucket: env('CF_BUCKET'),},/** * Set this Option to store the CDN URL of your files and not the R2 endpoint URL in your DB. * Can be used in Cloudflare R2 with Domain-Access or Public URL: https://pub-<YOUR_PULIC_BUCKET_ID>.r2.dev * This option is required to upload files larger than 5MB, and is highly recommended to be set. * Check the cloudflare docs for the setup: https://developers.cloudflare.com/r2/data-access/public-buckets/#enable-public-access-for-your-bucket */cloudflarePublicAccessUrl: env('CF_PUBLIC_ACCESS_URL'),},actionOptions: {upload: {},uploadStream: {},delete: {},},},},'image-optimizer': {enabled: true,config: {include: ['jpeg','jpg','png'],exclude: ['gif'],formats: ['original','webp','avif'],sizes: [{name: 'small',width: 500,},{name: 'medium',width: 750,},{name: 'large',width: 1920,},],additionalResolutions: [2],quality: 90,}satisfiesImageOptimizerConfig,},});
Is it posible to use strapi-plugin-image-optimizer along strapi-provider-cloudflare-r2 ?
I can use both separatelly but togetter they don't work. Any ideas?
Thanks in advice!
The text was updated successfully, but these errors were encountered: