how can I cast a File object to Image object? Either in the controller or in the view. I did not find a constructor or something similar in the Image class. I need the resizing methods from the Image class.
Thanks in advance
Maybe I expressed the problem unclear. I have an Image gallery where I only save the folder name and display all included image files. I now solved this by querying directly for images:
$images = DataObject::get("Image", "Filename LIKE '%$escaped_folder%'", "NAME");
But I would be interested if it is poosible to cast a Object<ViewableData<DataObject<File into Object<ViewableData<DataObject<File<Image