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

Images #71

Merged
merged 22 commits into from
Jul 25, 2014
Merged

Images #71

merged 22 commits into from
Jul 25, 2014

Conversation

Rizziepit
Copy link
Contributor

A start to image support: support file properties. Fixes #55.

This branch is still in progress.

@Rizziepit
Copy link
Contributor Author

grano-client changes to use files https://github.com/Rizziepit/grano-client/compare/file_support?expand=1

@pudo
Copy link

pudo commented Jul 19, 2014

This is really impressive. I'm a bit uncertain, to be honest, about whether we actually need image configs on a per-project, API-driven level. My initial sense is that making this an instance specific setting would be sufficient, and that it's more interesting to focus on uploading the rendered images somewhere to S3. This should be part of a plugin, though, not the application core.

@Rizziepit
Copy link
Contributor Author

My initial intention was to make it a plugin. This is difficult when the transformation + uploading of files has to happen dynamically, i.e. as soon as a property or an attribute changes (there is no schema change event and a bunch of race conditions creep in). Do we need files to be uploaded dynamically? Perhaps the plugin should have a management command instead that reads a yaml configuration and transforms and uploads image files accordingly?

What do you think about the files as property attributes?

@pudo
Copy link

pudo commented Jul 20, 2014

Given these concerns, would it be easier to make this a plugin which generates formats on demand via the API and then sets up a forced HTTP cache in front of that? We would still want to have a pre-defined set of configs to avoid cache-bombing, but it might be the easiest thing to build?

GET /api/1/files/48948/_image/thumb-48948-rounded.png with a cache of a day :)

@Rizziepit
Copy link
Contributor Author

I like GET /api/1/files/48948/_image/thumb-48948-rounded.png a lot. To clarify, that endpoint does not serve the file. It generates and uploads the file. So it becomes the application's responsibility to generate the correct images (via the loaders probably)?

Then the grano instance would have something like this in its settings:

IMAGE_FILE_CONFIG = {
    'thumbnail': {'width': 64, 'height': 64},
    ...
}

PLUGINS = ['ui', 'images']

And grano-images would provide the following endpoint:
GET /api/1/files/<file_pk>/_image/<file_name>-<file_pk>-thumbnail.png

@pudo
Copy link

pudo commented Jul 21, 2014

Ok, so after some discussion on Slack, we're going to go with the simplest solution; which is to render out images straight from the api (with a possible local file cache), and a good HTTP cache header set.

@Rizziepit
Copy link
Contributor Author

Image logic moved to https://github.com/Rizziepit/grano-images

pudo added a commit that referenced this pull request Jul 25, 2014
@pudo pudo merged commit dc5d18a into ANCIR:master Jul 25, 2014
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.

Image/media properties
2 participants