Skip to content

ensure that hardcoded filter formats are applied#86

Merged
lsmith77 merged 1 commit intomasterfrom
fix_filter_format_path_generation
Jun 30, 2012
Merged

ensure that hardcoded filter formats are applied#86
lsmith77 merged 1 commit intomasterfrom
fix_filter_format_path_generation

Conversation

@lsmith77
Copy link
Contributor

fixes #78

also reduces some code duplication and removes some ugly interaction between the resolver and cache manager

@lsmith77 lsmith77 mentioned this pull request Jun 29, 2012
lsmith77 added a commit that referenced this pull request Jun 30, 2012
ensure that hardcoded filter formats are applied
@lsmith77 lsmith77 merged commit 9559b9d into master Jun 30, 2012
@roderik
Copy link

roderik commented Jul 4, 2012

I'm sorry, but this has to be reopened. We deployed this in our project and all hell broke loose :) Seems like my test case covered up a major flaw.

The test project is updated with a change that demonstrates the problem. the flaw in the test case was that there was a source image, with the same name with both jpg and png extension. I've modified the names and in the test cases where we change the format, the controller throws an exception stating: Source image not found in ""
This is because it cannot find the source image with the different extension.

@lsmith77
Copy link
Contributor Author

lsmith77 commented Jul 4, 2012

it seems like there is a bit of a mess with the interaction between the cache manager, the resolver and the data loader. the data loaders have logic to look for files independent of their file extension, which is what we need here. i think this really needs some careful rethinking of the responsibilities of all of these classes and then making sure we use the right one in the right places .. not sure how soon i will get to this though :-/

can you open a new ticket for this please, referencing the old one?

@lsmith77
Copy link
Contributor Author

lsmith77 commented Jul 4, 2012

actually what you are noticing is the a "security measure" to prevent conversion to arbitrary formats:

diff --git a/app/config/config.yml b/app/config/config.yml
index 449fb72..bea20a3 100755
--- a/app/config/config.yml
+++ b/app/config/config.yml
@@ -60,6 +60,7 @@ jms_security_extra:
     secure_all_services: false

 liip_imagine:
+    formats: [jpg, png]
     cache_prefix: uploads/cache
     driver:       gd
     #cache:                no_cache

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.

format & file extension

3 participants