Creating thumbnail with custom extension

Hello, I am creating a thumbnail using imagine, this works great, but now I need customize the file extension (not png, or jpg)

I am getting this error:

This my code:


                        ->open(Yii::getAlias('@webroot') . "/assets/avatars/" . $file->baseName . $file->extension . "-big.")

                        ->thumbnail(new Box(50, 50))

                        ->save(Yii::getAlias('@webroot') . "/assets/avatars/" . $file->baseName . $file->extension . "-small." ,

                            ['quality' => 90]);

I understand that I can only have jpg, jpeg, gif or png but can I customize or change these values in the options array? I dont know that key-value pairs have to use, I dont found in the official docs too. Thanks


     * Saves the image at a specified path, the target file extension is used

     * to determine file format, only jpg, jpeg, gif, png, wbmp and xbm are

     * supported


     * @param string $path

     * @param array  $options


     * @throws RuntimeException


     * @return ManipulatorInterface


    public function save($path, array $options = array());

Your logic is a bit wrong, I think:

. "/assets/avatars/" . $file->baseName . $file->extension . "-big.")

should probably be:

. "/assets/avatars/" . $file->baseName . "-big." . $file->extension)

I want that my avatars have next name: "avatar.png-big". I add the "-big" suffix when I upload the images to my server.

Problem was that I dont know that properties I can change using "save" method when I create thumbnails

How are you going to solve the new mime types and all that?

The browser does not know how to deal with files of type ‘png-big’.