插入图片时,选择图片好像很慢才能跳出来,怎么解决
steps to reproduce
1. 2. 3.
browser version and os version
What is your browser and OS?
screenshot of issue
add screenshots which shows your issue(if needed). You can make gif from Recordit.
Plz write a title in English
大神,英文不好,有没有具体点的解法方法,或者代码也行,多谢!!!
I have a google. I have a translator. Ugh. Google Translator. I have an issue. I have Chinese. Ugh. Issue in Chinese. Chinese issue translated by Google!
Title: Insert pictures, select the picture seems to be very slow to jump out, how to solve
Commend: Great God, English is not good, there is no specific point of the solution method, or the code line, thank you
@onlyou As @alex1007 said, I (and we) might misunderstand your exact problem if you keep describing in Chinese. And I cannot speak in Chinese and you'll have to use some translators vice versa. And this is also applied for other languages. I and other contributors are mostly Korean, but we're trying not to use Korean and translate it in English for other developers.
BTW, following the translated text, it looks like you embedded a large picture. Need more information for investigation. Thanks.
@alex1007 @lqez steps to reproduce: 1.When I want to insert a picture, point to select the file, the page pops up too slowly
browser version and os version Chrome Ubuntu 14.04LTS
meet the same problem :)
it seems like a problem of Chorme on the lateset version.
when we use attribute accept="image/*" in <input> tag,the page will pops up slowly.
so,just replace <input type="file" accept="image/*"> with <input type="file" accept="image/jpg,image/jpeg,image/png"> or something else MIME type you need. it will be resolved.
first write issue,sorry for my poor english :)
reference:input['file'] accept=“image/*” open dialog so slow with Chrome
以下是中文:
貌似是Chrome的问题,想办法把 <input type="file" accept="image/*"> 换成<input type="file" accept="image/jpg,image/jpeg,image/png">就行了。
Try Another Version!!
@onlyou
「Talk is cheap. Show you the code」
Html tag as bellow:
<textarea id="summernote" class="summernote" name="description" placeholder="this is a demo" > </textarea>
All my javascript code as bellow:
$(document).ready(function () {
$(".summernote").summernote({
popover: {
image: [
['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']],
['float', ['floatLeft', 'floatRight', 'floatNone']],
['custom', ['imageAttributes', 'imageShape']],
['remove', ['removeMedia']]
],
},
lang: 'zh-CN',
minHeight: 300,
dialogsFade: true,// Add fade effect on dialogs
dialogsInBody: true,// Dialogs can be placed in body, not in
disableDragAndDrop: false,// default false You can disable drag and drop
callbacks: {
onImageUpload: function (files) {
var $files = $(files);
var $this = $(this);
$files.each(function () {
var file = this;
var data = new FormData();
data.append("file", file);
$.ajax({
data: data,
type: "POST",
url: "/publish-upload-file",
cache: false,
contentType: false,
processData: false,
success: function (response) {
$this.summernote('insertImage','http://myfileserver/'+response, function ($image) {});
},
error: function (xhr, ajaxOptions, thrownError) {
if (xhr.responseText) {
toastr.error(xhr.responseText, 'Inconceivable!')
} else {
console.error("
This is a bug of Chrome which could be reproduced in China Great Network
https://stackoverflow.com/questions/39187857/inputfile-accept-image-open-dialog-so-slow-with-chrome
$(document).ready(function() {
$('#summernote').summernote();
$('.note-image-input').prop('accept', 'image/jpeg, image/jpg, image/png, image/gif');
});