Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot instantiate any of ImageEditors classes #241

Open
LeTraceurSnork opened this issue Oct 30, 2024 · 4 comments
Open

Cannot instantiate any of ImageEditors classes #241

LeTraceurSnork opened this issue Oct 30, 2024 · 4 comments

Comments

@LeTraceurSnork
Copy link

Describe the bug
Cannot instantiate any of ImageEditors classes with an error:

Fatal error: Uncaught Error: Class "WP_Image_Editor" not found in ...

To Reproduce
Steps to reproduce the behavior:

  1. Try to instantiate class StorageImageEditor like that:
new StorageImageEditor($image_upload_dir . $file_name);

Expected behavior
Ability to instantiate the ImageEditor class and operate with it to be able upload files

Screenshots
image

Server (please complete the following information)

  • Linux 29dc86ad20f3 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 GNU/Linux
  • PHP Version 8.2.17
  • Web Server | Ubuntu under Docker
  • Using PHP-FPM? - No
  • Using WordPress Cron? - No

How did you install the plugin?
Via composer (wpackagist-plugin/ilab-media-tools)

Additional context
None

@jawngee
Copy link
Contributor

jawngee commented Oct 30, 2024 via email

@LeTraceurSnork
Copy link
Author

You need to manually include

Well, ok, first of all - that helped
Second of all - I've managed to solve my problem in other way than StorageImageEditor, nvm then
Third of all - IMHO that is nonsense:

not sure that it's a good idea to use the storage image editor directly

The plugin presents some functionality that not only I'm, as a user, not suppose to use (main contributor suggests it 😯), it also simply doesn't actually work w/o some additional manipulations

@jawngee
Copy link
Contributor

jawngee commented Oct 31, 2024 via email

@LeTraceurSnork
Copy link
Author

You shouldn't use it directly because it isn't intended to be used directly

At least, please, mention it in PHPDoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants