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 in R Weekly show up full size in my Gmail #172

Open
luyongxu opened this issue Jan 29, 2018 · 22 comments
Open

Images in R Weekly show up full size in my Gmail #172

luyongxu opened this issue Jan 29, 2018 · 22 comments

Comments

@luyongxu
Copy link

All the images that are attached to the R Weekly show up really big (too big) when I view the email in my Gmail.

@tbs17
Copy link
Contributor

tbs17 commented Jan 29, 2018

can you let us know which edition of rweekly you are referring?

@jonocarroll
Copy link
Member

This is the case for me also. I suspect there is some CSS on the site which does not translate to the emails.

screen shot 2018-01-30 at 7 31 04 am

@luyongxu
Copy link
Author

This has happened to every single R Weekly that I've ever received. But for a specific example, the tf-idf image in "R Weekly 2018-5 Interview, DataFramed - Weekly Updates from the R Community" is extremely big. Sorry I didn't include a screenshot.

I love reading the R Weekly. Please keep up the good work.

@qinwf
Copy link
Member

qinwf commented Jan 30, 2018

Thanks for the report, we will resize the images to the same width in the future release.

@luyongxu
Copy link
Author

luyongxu commented Feb 5, 2018

Images were good size in latest R Weekly. Thank you. Closing issue.

@luyongxu luyongxu closed this as completed Feb 5, 2018
@luyongxu
Copy link
Author

Images are too big again in the latest issue.

image

@luyongxu luyongxu reopened this Sep 10, 2018
@maelle
Copy link
Contributor

maelle commented Sep 25, 2020

was this only a problem in one issue @qinwf? I'd like to close this if no action is required.

@gadenbuie
Copy link
Contributor

This still happens for me in all of the rweekly emails. If someone on the rweekly team could outline how the emails are generated or point to the templates, I'd be happy to take a look (or it'd be useful information for someone else to tackle the problem).

@qinwf
Copy link
Member

qinwf commented Sep 27, 2020

The email is sent by Google FeedBurner. The email will use the same image as the post.

If the post uses a small resized image in the post, and the email will use the small image.

We will add a tip for the editor to resize the large image before publishing the draft.

Thanks for the report.

@jonocarroll
Copy link
Member

I tend to do this manually, but only after initially uploading the original size image then remembering to shrink it via gimp. It's a bit of a hassle and becomes dependent on an external tool.

Could we add a GitHub Action to resize new images in the rweekly/image repo to a maximum size (imagemagick or the R-wrapper thereof)? Would that change the URL?

Options from a quick search:
https://github.com/marketplace/actions/image-resizer-inplace
https://github.com/marketplace/actions/image-resizer-action

Another option would be a function (R, of course) to do this locally which:

  • takes a local image filepath and the path to the rweekly/image local clone,
  • resizes the image to a maximum dimension,
  • commits and pushes to rweekly/image,
  • returns the raw.githubusercontent.com link as a markdown link ready to be inserted into the draft.

I'm happy to prototype this option even if we decide to go with Actions. It could make inserting images that little bit easier. This is probably also the right time to start rweekly.tools.

@jonocarroll
Copy link
Member

Watch this space! https://github.com/rweekly/rweekly.tools

@maelle
Copy link
Contributor

maelle commented Sep 29, 2020

Awesome idea @jonocarroll! I use GIMP too for resizing and yes it's a hassle. 😉

Are we sure the images that are re-sized to 800px width are ok in emails btw?

The raw link is not a permalink.

@jonocarroll
Copy link
Member

The raw link is what we use in the issue, though, e.g. raw.githubusercontent.com/rweekly/image/master/YYYY-MM-DD/filename.png but for a moment I thought these files used hashes - I probably uploaded some files with autogenerated filenames.

The function would then do something like this (some defaults would be set):

upload_image(file = "image_for_this_issue.png", 
             caption = "image caption", 
             width = "800px",
             issue = "2020-10-05",
             image_repo = "../image", 
             push = TRUE)
* resizing to maximum width 800px
* issue not found in rweekly/image, creating 2020-10-05
* saving original and resized images to rweekly/image/2020-10-05/
* committing original and resized images to rweekly/image local repo
* pushing to rweekly/image remote
* converting link
Insert the following into the draft issue:
![image caption](https://raw.githubusercontent.com/rweekly/image/master/2020-10-05/image_for_this_issue_800px.png)

@gadenbuie
Copy link
Contributor

The resized images are helpful and I really appreciate that you're tackling this. With very large (wide) images, it becomes almost impossible to read the email on mobile (which is how I read email, really).

I do wonder, though, if it would be possible to address this with CSS? For example if it's possible set a max-width on the image (or the email page) it may be possible to avoid the need for resizing. Plus 800px is much better than 1200px+, but it's still wider than a typical phone screen which is closer to 400px wide.

@maelle
Copy link
Contributor

maelle commented Oct 2, 2020

@qinwf is there any way to add CSS to Google Feedburner emails?

@jonocarroll
Copy link
Member

I resized images to 600px wide with a new function in rweekly.tools this week - the email images show up only ever so slightly larger than my screen width on mobile (Samsung Galaxy S10+) but that's presumably highly dependent on device.

CSS in the email would hopefully get us even closer, but how is this in the meantime? It should prevent extremely large images, at least.

@qinwf
Copy link
Member

qinwf commented Oct 9, 2020

I will try using CSS, but I think it may not work. I will report the result in the wiki https://github.com/rweekly/rweekly.org/wiki/TODO:-Email-Images-Resizing

@maelle
Copy link
Contributor

maelle commented Nov 27, 2020

@qinwf any update?

@gadenbuie
Copy link
Contributor

This is still frequently a problem for me, as very often the R Weekly email is essentially unreadable on mobile. It's often due to large images but even with reasonable image sizes the unstyled Feedburner email is still difficult to read.

As a proof of concept, I tried blastula with the latest RWeekly email. You can preview the email here where you can see that it responsively limits image size and works well on both small and large screens. (For comparison, I've also uploaded roughly the current weekly email as I see it in gmail.)

Here's the source Rmd file with minimal changes from the .md file used in this repo. Alternatively, you could keep the .md file for the repo and use a separate script to build a better, more customized email body using compose_email(). But even the minimal version would be a huge improvement.

@BatoolMM
Copy link
Member

@gadenbuie Sorry, you are still experiencing a problem with R Weekly email. We had a discussion recently about this issue and we are working on fixing it. Thank you for proposing multiple solutions 😊. We'll try to address the problem again this week.

@qinwf
Copy link
Member

qinwf commented Jan 28, 2021

@gadenbuie Thank you for the example to send emails with blastula.

I will update the rweekly editing tool to resize images for the draft post this week.

I think GitHub Pages is simpler to build the website. Maybe we will not introduce an extra step to build the pages.

@privefl
Copy link
Contributor

privefl commented May 17, 2022

This is the latest issue, with maximum zoom on by smartphone.

Screenshot_20220517-074228

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

No branches or pull requests

8 participants