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: Check image sizes, show which ones are too big #43

Open
YodaSpow opened this issue Sep 3, 2019 · 7 comments
Open

Images: Check image sizes, show which ones are too big #43

YodaSpow opened this issue Sep 3, 2019 · 7 comments

Comments

@YodaSpow
Copy link
Owner

YodaSpow commented Sep 3, 2019

Is your feature request related to a problem? Please describe.
Would like to check if images are too big, not the width or height but the actual KB/MB.

Describe the solution you'd like
Thinking any image which over 300KB would get flagged with a pop up.

Describe alternatives you've considered
Lists all images in an email that is too large, preferably there would be a tooltip showing

Example from Litmus Rendercheck
Sizes

@YodaSpow
Copy link
Owner Author

YodaSpow commented Sep 3, 2019

Post:
http://voidcanvas.com/how-to-get-the-memory-size-byte-kb-mb-of-an-image-or-other-files-without-loading-it-by-javascriptajax/

<!DOCTYPE html>
<html>
	<head>
		<title>Get memory size of a file</title>
		<script type="text/javascript" src="main.js"></script>
	</head>
	
	<body onLoad="toGetSize()">

	</body>
</html>
function toGetSize() {

var obj = new XMLHttpRequest();
obj.open('HEAD', 'images/1.png', true);
obj.onreadystatechange = function(){
  if ( obj.readyState == 4 ) {
    if ( obj.status == 200 ) {
      alert('Size in bytes: ' + obj.getResponseHeader('Content-Length'));
    } else {
      alert('ERROR');
    }
  }
};
obj.send(null);

}

@YodaSpow
Copy link
Owner Author

YodaSpow commented Sep 3, 2019

@YodaSpow
Copy link
Owner Author

YodaSpow commented Sep 3, 2019

@YodaSpow
Copy link
Owner Author

YodaSpow commented Sep 3, 2019

@YodaSpow
Copy link
Owner Author

YodaSpow commented Sep 3, 2019

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

1 participant