question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ghost Image Output

See original GitHub issue

A hypothetical scenario for clarity: One particular post looks something like this (image dimensions are of original uploaded media). This is the content which the user has defined.

  • Text
  • Image (500x200)
  • Text
  • Text
  • Image (600x400)
  • Text
  • Image (1024x800)

Separately, the theme defines the following criteria about how it would like to display the images on the front end.

  • The default size for all images in the blog content of this theme is 600x400
  • The theme can display a featured image (on the homepage or in search results) this image is 100x100
  • The theme has a secondary size for its featured image on a different template, which is 200x100

Installation / Image Sizes

When a theme is activated/installed, it runs a process (preferably in the background, in order of newest to oldest) to resize images to the sizes it needs.

If any images are too small (the original media size) they are left alone.

Consideration: How does this work with 3rd party image services? Do they simply mirror the local Ghost image directory?

Featured Images

What if the concept of a “featured image” is simply the first image that appears (completely optionally) in any post.

Turning the concept of the WordPress featured image on its head - rather than the user being forced to create an entity defined as a thumbnail, the theme checks for something which it can use as a featured image.

Ghost scans a post to see if an image is available to use as a featured image - when it finds one, it uses it. If no image exists in the post which meets the required dimensions - a featured image is not assigned.

Markdown

We are extending markdown to produce some new functionality with the Ghost editor. By typing the following syntax:

!image[alt text](source)

an image uploader is generated in the content preview pane. Once an image is uploaded via this upload form, the markdown is then populated with the appropriate data. Eg:

!image[bananas](http://localhost/ghost/content/images/bananas.jpg)

Consideration: Is changing the official markdown tag of ![alt](src) to !image[alt](src) worth it? The initial thinking was to differentiate between image/video/something. But it might make sense to keep the ![alt](src) syntax for any type of media which is then detected automatically.

Multiple Image Sizes

Ghost does not support dynamic image sizes within content, it also does not support images being floated around differently within text. An image is a block of media equivalent to a paragraph. The theme can style that image to fit within its design.

It would be good if themes could define different sizes of image, so that users could still display content differently.

For example, an image that fits the width of the screen (“full”) image

or an image that fits the width of the content (“standard”) image

Considerations:

  • How could this control be achieved within the post preview UI?
    • Potentially overlaid toggle on the image preview that can switch the image between output sizes.
  • How could this control be achieved (and translated) in markdown?
    • This would have to extend Markdown in a non-standard way
    • Potentially something like ![alt][size](src)
  • How would we handle sizes being input incorrectly / not working / being changed?
    • Fall back to a standard image size
    • If the image is too small to be displayed at the standard image size - display the original media

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:27 (22 by maintainers)

github_iconTop GitHub Comments

3reactions
cgiffardcommented, Aug 1, 2013

Just realised you wouldn’t even need to write JS to provide basic support for it. You could easily match on a CSS attribute selector:

img[src$="#thumb"] {
    float: left;
    clear: right;
    width: 200px;
    height: 200px;
}
0reactions
JohnONolancommented, Aug 18, 2014

Moved on so far from this already. Advanced image controls should still be a thing - but this issue is stagnant and isn’t worth keeping around. Future work/discussion can start in a new issue once we circle back around to this sort of concept (which is likely to be significantly different to things proposed here)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ghost Images: What Are They, and How Do You Get Rid of ...
A ghost image is a stain in the mesh of the screen. This can occur from either the ink or emulsion used to...
Read more >
How to fix ghost printing - LD Products
Ghost printing happens when an image or text is repeated more than once on a printed page. This is often caused by an...
Read more >
How to fix ghost images (double printing) when using a printer
What causes ghosting when using a printer. How can you fix ghosting?Here you'll find troubleshooting tips to correct ghosting on prints.
Read more >
A ghost image appears in print results.(Pro6410Neon) - OKI
The following factor(s) may cause a ghost image of the printed pattern. - The darkness is too high. - The print adjustment is...
Read more >
How to Fix Ghosting When Using a Laser Printer and Toner ...
Fuser units can also cause ghosting. If a fuser unit is not heating the toner powder correctly, ghost images can appear when printing....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found