Skip to content

Image Manipulation Class #2498

Description

@Henqsan

Hello!

I am trying to implement the image manipulation library in my controller. But when I try to use the base_url() path, the library cannot find the path!

$path_save = base_url('assets/images/test.jpg');

            $image = \Config\Services::image()
           ->withFile($image_file->getTempName())
           ->fit(100, 100, 'center')
           ->save($path_save);

What is the difference in using the path to the directory where the image will be saved like this:

base_url('assets/images/test.jpg')

and this way:

'../public/assets/images/test.jpg'

Is there a correct way to indicate the directory path to save the image?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions