Problems with thumbnails from Soundcloud and YouTube oneboxes

As discussed, thumbnailing production logic is now built into core.

What TLP used to have to do is no longer necessary, largely.

For reference, the core criteria for inclusion are the following:

  def extract_images_for_post
    # all images with a src attribute
    @doc.css("img[src]") -
    # minus emojis
    @doc.css("img.emoji") -
    # minus images inside quotes
    @doc.css(".quote img") -
    # minus onebox site icons
    @doc.css("img.site-icon") -
    # minus onebox avatars
    @doc.css("img.onebox-avatar") -
    # minus small onebox images (large images are .aspect-image-full-size)
    @doc.css(".onebox .aspect-image img")
  end

from https://github.com/discourse/discourse/blob/master/lib/cooked_post_processor.rb

TLP modifies this slightly, but only to loosen it up. I’d like to drop this override completely if possible:

  def extract_images_for_post
    # all images with a src attribute
    @doc.css("img[src]") -
    # minus emojis
    @doc.css("img.emoji") -
    # minus images inside quotes
    @doc.css(".quote img") -
    # minus onebox site icons
    @doc.css("img.site-icon") -
    # minus onebox avatars
    @doc.css("img.onebox-avatar") #Broader criteria than Discourse Core
  end

from https://github.com/paviliondev/discourse-topic-previews/blob/master/lib/cooked_post_processor_edits.rb

As you can see I am reducing the amount of exclusions by allowing small onebox images as defined by core.

Rather than maintaining this in TLP, it would be good to get consensus and parity across the use cases, so I don’t have to maintain this in the plugin at all.

This is also relevant to you @Arkshine

3 Likes