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

Image Handling #6

Open
ChristopherBiscardi opened this issue Jan 4, 2016 · 2 comments
Open

Image Handling #6

ChristopherBiscardi opened this issue Jan 4, 2016 · 2 comments

Comments

@ChristopherBiscardi
Copy link
Member

We have img-loader, but we want more.

The Blog Post content type should have handling for Featured Images. What do these featured images look like?

How can we achieve Preview Photos? Removing the jpeg headers is probably not an option for us initially. HTML pages will need to render the blurred version of the photo and the "real" version likely won't load until the javascript does.

We also need to do this for images inside markdown, which means the solution we use for the featured image is going to have to be included in a markdown-it plugin as well. This points to building a re-usable library to achieve this affect.


Update Jan 21, 2015

There are, roughly speaking, 3 TODOs here

  1. Implement imagemagick-loader
  2. Implement a React Element (<Magick />) which provides a declarative interface to imagemagick-loader
  3. Implement a Markdown-It plugin which adds the equivalent of <Magick /> to the markdown syntax
    • Implement React Element (<MagickReader />) that provides an easy way to consume imagemagick-loader output (which should be json, since it'll come back from the API)

ImageMagick Loader

A Webpack loader that processes images in all sorts of ways. Allowing require('what.png?max-width=960') type statements, which will be generated by the markdown and react interfaces.

This element would accept an image src and attributes that map to the loader options.

<Magick src='./whatever.png'>
  <Size max-width='960px' />
  <Size max-width='480px' />
</Magick>

which compiles to an img tag with srcset declarations.

Markdown-It Plugin

Roughly same as above.

Includes a React element that accepts a spread json object (supplied from a graphql query)

@ChristopherBiscardi
Copy link
Member Author

There are a number of APIs that exist to serve the purpose of image translation. Examples below:

Cloudinary

cloudinary

http://res.cloudinary.com/demo/image/fetch/w_365,h_140,c_fill,r_20,e_saturation:50,f_auto/http://upload.wikimedia.org/wikipedia/commons/8/81/Waves_lajolla.jpg
imgix

imgix-example

https://assets.imgix.net/examples/clownfish.jpg?auto=format&dpr=1&fit=crop&h=580&ixjsv=2.1.0&q=60&w=1140

@ChristopherBiscardi
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant