搜索低分辨率的大图像(Searching for large images made from a low resolution)
我在本地驱动器上有很多产品图片,我从不同的来源获得,其中一些图像搞砸了。 我说的是分辨率很高的图像,但很明显,这个分辨率是通过从非常小的来源调整图像大小来实现的。
是否有软件或某些东西可以找到这些通常高分辨率但质量低的图像? 谢谢你的任何想法。
I have many product images on my local drive that I got from different sources and some of them are messed up a bit. I'm talking about images that are large in resolution but it is apparent that this resolution has been achieved by resizing the image from a very small source.
Is there a software or something that could find these usualy high-res but low quality images? Thanks for any ideas.
原文:https://stackoverflow.com/questions/45965998
最满意答案
问题不在于
onload
。 您只是在存在之前访问该属性。您永远不会在
HomeView
构造函数中设置this.el
:$("body").html(this.el); this.template = _.template($('#main-template').html()); this.render();
你正在调用
this.render()
,它访问this.el.innerHTML
,但在这三行中你设置this.el
? 无处。如果
this.el
应该由View
设置,那么在访问之前你必须调用父构造函数:constructor() { super(); $("body").html(this.el); this.template = _.template($('#main-template').html()); this.render(); }
The problem is not with
onload
. You are simply accessing a property before it exists.You are never setting
this.el
in yourHomeView
constructor:$("body").html(this.el); this.template = _.template($('#main-template').html()); this.render();
You are calling
this.render()
, which accessthis.el.innerHTML
, but where in these three lines are you settingthis.el
? Nowhere.If
this.el
supposed to be set byView
, then you have to call the parent constructor before you accessthis
:constructor() { super(); $("body").html(this.el); this.template = _.template($('#main-template').html()); this.render(); }
相关问答
更多-
window.onload和jquery ready有什么区别[2022-04-18]
加载时间不一样,前者是页面打开的同时加载,或者是当页面加载完成之后在去加载效果,单页面小的时候,时间上看不出什么差别 -
window.onload和$(document).ready()之间的区别在jQuery教程中有解释 我引用: 大多数JavaScript程序员最终做的第一件事是为他们的程序添加一些代码,类似这样: window.onload = function(){ alert("welcome"); } 里面是你想在页面加载时运行的代码。 然而,问题是,直到所有图像完成下载(这包括横幅广告),Javascript代码才会运行。 首先使用window.onload的原因是,当您第一次尝试运行代码时,HTML“文档” ...
-
ready事件发生在HTML文档加载完成之后,当所有内容(例如图像)也被加载时,稍后会发生onload事件。 onload事件是DOM中的标准事件,而ready事件是特定于jQuery的事件。 ready事件的目的是在文档加载后尽可能早地发生,从而为页面中的元素添加功能的代码不必等待所有内容加载。 The ready event occurs after the HTML document has been loaded, while the onload event occurs later, when ...
-
在window.onload运行某些内容可确保在函数运行之前加载所有DOM元素。 如果函数访问或修改DOM,则需要使用它。 christmasDayCalculation()和hockeyTeams()不访问DOM,因此不需要在window.onload运行它们。 当窗口加载时,你实际上并没有运行它们,因为你没有在它们周围放置function() 。 当你这样做 window.onload = hockeyTeams(); 它立即运行该函数,然后将它返回的值赋给window.onload 。 当你写作 w ...
-
是的,你可以假设它将在浏览器中加载整个页面后执行 yes you can assume as it will get executed after entire page loaded in browser
-
问题不在于onload 。 您只是在存在之前访问该属性。 您永远不会在HomeView构造函数中设置this.el : $("body").html(this.el); this.template = _.template($('#main-template').html()); this.render(); 你正在调用this.render() ,它访问this.el.innerHTML ,但在这三行中你设置this.el ? 无处。 如果this.el应该由View设置,那么在访问之前你必须调用父构造 ...
-
jsFiddle: https ://jsfiddle.net/CanvasCode/ouk7aatj/ 最后一个onload将被触发,所有以前的onload语句将被忽略 window.onload= function() { alert("Onload 1"); }; window.onload= function() { alert("Onload 2"); }; var i = 0; window.onload= function() { i = 10; alert(i); ...
-
page.open(url, function(status){...})只是另一种表示法 page.onLoadFinished = function(status){...}; page.open(url); 你可以在这里找到报价: 另请参阅WebPage #open以获取onLoadFinished回调的备用挂钩。 由于这是一个基于AJAX的页面,您需要等待数据出现。 您只能通过反复检查页面的特定部分来实现。 您可以在phantomjs 安装的示例目录中找到示例或此处 。 这可能也适用于通过npm- ...
-
是否真的有必要等待DOM准备好操纵DOM?(Is it really necessary to wait for DOM ready to manipulate the DOM?)[2021-12-27]
如果您的JavaScript代码低于DOM元素并且仅以独占方式修改它们,则无需等待DOM ready事件。 但是,请记住编辑一个DOM元素,该元素包含一个script元素(或更具体地说,在元素的结束标记之前),用于在IE6(感谢TJ Crowder )和IE7中引起大问题 。 但是,这需要内联scripts ,这可能是一个维护问题。 最好让你的JavaScript存储在外部(很多人都会谈到在关闭body标签之前包含它们的好处),以获得诸如易于维护和细粒度缓存控制等诸多好处。 If your JavaScri ... -
虽然我认为@ jAndy的答案是正确的,但你可以通过在ready()调用中将代码放在onload来为自己提供一些额外的保证。 只需确保您的主要ready()调用是第一位的。 $(document).ready(function() { // Your normal ready handler }); $(window).load(function() { // Placing code in another .ready() call in here will add it to the ...