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

Annotations Convert and ConvertMultiple #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

foaly-nr1
Copy link
Contributor

As previously brought up, please consider my implementation attempt of the Convert annotation

// ...
use Snowcap\ImBundle\Doctrine\Mapping as SnowcapIm;
// ...

  /**
   *
   * @Assert\File(maxSize="6000000")
   * @SnowcapIm\Convert(params={"thumbnail"="100x100>"}, targetProperty="thumbnail")
   */
  public $file;

  public $thumbnail;

as well as the ConvertMultiple annotation

// ...
use Snowcap\ImBundle\Doctrine\Mapping as SnowcapIm;
// ...

  /**
   *
   * @Assert\File(maxSize="6000000")
   * @SnowcapIm\Mogrify(params={"resize"="1024"})
   * @SnowcapIm\ConvertMultiple({
   *     @SnowcapIm\Convert(params={"resize"="612"}, targetProperty="medium"),
   *     @SnowcapIm\Convert(params={"thumbnail"="100x100>"}, targetProperty="thumbnail")
   * })
   */
  public $file;

  public $medium;

  public $thumbnail;

I am almost there, but I am struggling in the last step because the convert method of the Manager class only allows paths relative to the web root for the input file. I am currently uncertain as to a good solution to this problem and would be thankful for any suggestions.

@foaly-nr1 foaly-nr1 changed the title Annotations Convert and ConvertMutliple Annotations Convert and ConvertMultiple Dec 2, 2015
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

Successfully merging this pull request may close these issues.

1 participant