It's easier to enter paths like public://files/my-image.png in the config. Of course get the real path afterwards.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Fleshgrinder’s picture

Because the module wasn't working correctly (no offense and maybe all errors I got were already fixed) I created my own methods within my template.php file and I'm using exactly what you are requesting.

@dev It's very easy to get the real path to the image. As far as I know, it's possible to pass any URI to these functions, the check for public:// themselves.


// Without image style.
$vars['og_image'] = file_create_url($image_path);

// With image style (crop + resize to 130 x 130).
$vars['og_image'] = image_style_url('og_image', $image_path);

It would be best if the module directly provides the og_image style (crops + resize to 130 x 130; which is the preferred format by Facebook). Hope I was from any help.

DamienMcKenna’s picture

Component: Code » Open Graph
DamienMcKenna’s picture

Title: Allow public:// for entering OG image path » Allow public:// for entering image paths
Component: Open Graph » Other tags
Issue summary: View changes

Lets make this generic.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
1.34 KB

This seems like it should work - any image URL values that start with 'public://' are passed through file_create_url().

DamienMcKenna’s picture

FileSize
1.39 KB

This one actually works ;)

DamienMcKenna’s picture

Going to sneak this into the next release.

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed.

  • DamienMcKenna committed 9a283b9 on 7.x-1.x
    Issue #1355788 by DamienMcKenna: Allow use of 'public://' file scheme...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.