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

handle image extensions in doctrine loader #276

Merged
merged 1 commit into from
Dec 4, 2013
Merged

Conversation

dbu
Copy link
Member

@dbu dbu commented Dec 2, 2013

This is a first step towards #78 - we try to lookup an image also without file extension. this is more of a content negotiation thing than of proper ids, so @lsmith77 and i feel it belongs here rather than for example https://github.com/symfony-cmf/MediaBundle/blob/master/Doctrine/Phpcr/MediaManager.php#L121

with this change it will become possible to at least build your image urls with a hardcoded format, e.g. use format: jpg in the filter definition, or put it into the output like {{ item.image.id | imagine_filter('header_desktop') }}.jpg

/cc @rmsint

@dbu
Copy link
Member Author

dbu commented Dec 3, 2013

even though there is #277 i would love to merge this now, as right now its impossible to force the image format. #277 would be a BC break anyways, so we can then break BC here as well, if needed. right now its no BC break, just more options.

// try to find the image without extension
$info = pathinfo($path);
$name = $info['dirname'].'/'.$info['filename'];

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra new line

lsmith77 added a commit that referenced this pull request Dec 4, 2013
handle image extensions in doctrine loader
@lsmith77 lsmith77 merged commit 47e2b2b into master Dec 4, 2013
@lsmith77 lsmith77 deleted the tweak-doctrine-loader branch December 4, 2013 09:43
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.

2 participants