Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

Bedrock Compatibility #23

Open
chicharitomagnetico opened this issue May 16, 2019 · 8 comments · May be fixed by #25
Open

Bedrock Compatibility #23

chicharitomagnetico opened this issue May 16, 2019 · 8 comments · May be fixed by #25

Comments

@chicharitomagnetico
Copy link

Would it be possible to make the plugin work with Bedrock?
https://roots.io/bedrock/docs/bedrock-compatibility/

@junaidbhura
Copy link
Owner

Hi @chicharitomagnetico it should work with any WordPress architecture, as long as the images are available locally to the plugin.

Does it not work now? If not, what exactly is the problem?

@chicharitomagnetico
Copy link
Author

It seems that the plugin it's not creating the cropped image.
I changed the path of the image folder, and the plugin created the folder on the uploads folder. The folder has the proper permissions but it doesn't contain images.

/Users/alderaan/playus/wordpress_dev/playus_site_16/playus-wp/bedrock/web/app/uploads/playus-images
Writeable!

When I check the images folder, it's empty. This doesn't happen with normal architecture.

@junaidbhura
Copy link
Owner

I think you might have to change the directory where this plugin stores and looks for images. You might need to use the fly_dir_path hook. Something like:

/**
 * Update Fly Images directory.
 *
 * @param string  $path
 * @return string
 */
function my_fly_dir_path( $path = '' ) {
	return '/Users/alderaan/playus/wordpress_dev/playus_site_16/playus-wp/bedrock/web/app/uploads/fly-images';
}
add_filter( 'fly_dir_path', 'my_fly_dir_path' );

More info here: https://github.com/junaidbhura/fly-dynamic-image-resizer/wiki/Actions-&-Filters

@chicharitomagnetico
Copy link
Author

chicharitomagnetico commented May 17, 2019

I moved the folder using:

/*-------------------------------------------------------------------------------------*/
/* Change Fly Images Path
/*-------------------------------------------------------------------------------------*/
function change_fly_path( $path = '' ) {
	require_once(ABSPATH . 'wp-admin/includes/file.php');
	$absolute = get_home_path();
	return $absolute.'app/uploads/playus-images';
}
add_filter( 'fly_dir_path', 'change_fly_path' );
//////////////////////////////

The plugin created the folder but it's not creating the cropped images.

@junaidbhura junaidbhura linked a pull request Jun 11, 2019 that will close this issue
@junaidbhura
Copy link
Owner

@chicharitomagnetico I've fixed this on another branch: https://github.com/junaidbhura/fly-dynamic-image-resizer/tree/fly-dir-path

Could you please test and let me know if it's all okay? If it is, I'll merge it in and release a new version of this plugin.

@chicharitomagnetico
Copy link
Author

Hola @junaidbhura I tested the branch with the same results, still not working.
I tested it on another environment (not Bedrock) and it works ok.

@junaidbhura
Copy link
Owner

Hey @chicharitomagnetico I just checked with Bedrock, and it does seem to work okay.

Can you try removing the filter fly_dir_path and trying again?

@chicharitomagnetico
Copy link
Author

Sorry, I finished the project with another solution, but now that I have a little time I want to make it work.
I used the branch you created, it is creating the files, but now when I use fly_get_attachment_image_src
it returns a URL like this one
www.localsite.com/Users/alderaan/playus/wordpress_dev/bellybus/bedrock/web/app/uploads/fly-images/12/belly-bus-food-trucks-800x588-c.png

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

Successfully merging a pull request may close this issue.

2 participants