Skip to content

๐Ÿ–ผ๏ธ High performance, secure and easy-to-use image optimizer for Strapi CMS.

License

Notifications You must be signed in to change notification settings

magictm/strapi-plugin-ipx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Project Logo


NPM version NPM Downloads GitHub stars


MagicTM ยท Ipx ยท Strapi Plugin

๐Ÿ–ผ๏ธ The MagicTM Ipx Strapi Plugin High performance, secure and easy-to-use image optimizer for Strapi CMS.

๐ŸŒ Follow me: https://stawowczyk.me

โ›“ Versions

Strapi v4 - (current) - v1.x

Tested on Strapi v4.25.4.

Motivation

This plugin was originally created in https://github.com/strapi-community/strapi-plugin-local-image-sharp. Due to lack of maintenance, I decided to create a new plugin with the same functionality and more features.

๐Ÿ“ฆ Features

  • Image Processing: Resize, crop, and optimize images on the fly.
  • Cache: Cache processed images for faster loading times.
  • Custom Paths: Define custom paths for ipx to listen on.
  • Configuration: Configure cache directory, cache duration, and more.
  • [] TODO: Debug Mode: Enable detailed logs for debugging purposes.
  • [] TODO: Delete Cache: Delete cache files on demand or automatically.

๐Ÿ’ป Install

1. Install the plugin

npm install @magictm/strapi-plugin-ipx

2. Enable the plugin

Navigate to your Strapi project's configuration file: <strapi app root>/config/plugins.js or .ts

Add the following code snippet:

Minimal configuration:

'magictm-ipx': {
    enabled: true,
}

Advanced configuration

'magictm-ipx': {
    enabled: true,
    config: {
        // Enable debug mode for detailed logs
        debug: false,
        // Cache dir
        cacheDir: '.my-cache',
        // Cache duration in seconds
        maxAge: 3600,
        // Paths for ipx to listen on
        paths: ['/uploads'],
    },
}

cacheDir can also be configured in .env file settings STRAPI_PLUGIN_MAGICTM_IPX_CACHE_DIR.

Full example (typescript)

export default () => ({
    // other plugins

    'magictm-ipx': {
        enabled: true,
    },
})

3. (Re)Start Your Application

For the changes to take effect, restart your Strapi application:

npm run develop

๐Ÿš€ Usage

Same as https://github.com/unjs/ipx

๐Ÿค Contributing

Contributions to the MagicTM Ipx Strapi Plugin are always welcome! To contribute:

  • Fork the repository.
  • Create a new branch for your feature/bug fix.
  • Commit your changes with descriptive messages.
  • Push your changes to your forked repository.
  • Submit a pull request to the master branch.

โ˜•๏ธ Help me keep working on this project ๐Ÿ’š

If you find this plugin valuable, consider supporting its development. Your contribution helps me maintain and improve this project.

๐ŸŽ–๏ธ Sponsors

We appreciate all sponsors! Please contact us if you're interested in sponsoring this project.

๐Ÿ“œ License

MIT License ยฉ 2024-PRESENT Marcin Stawowczyk (m7rlin)

Thank you for using the MagicTM Ipx Strapi Plugin! Let me know if you have any other questions.