blueimp jquery uploader - on loaded, MB label changes to KB label - blueimp

Using Blueimp jquery uploader with php. When I upload a file of size XX MB, on finishing the upload, the progress area refreshes with the link, size & "Clear" button, as expected, except:
The "MB" label changes to "KB"
The actual size is still correct, it just displays the wrong units
Ex: A 4.5MB file displays as 4.5KB
Where can I find this area of the code to try to track this down? I'm not overriding anything in this "finished" code

$('.size').text().replace('KB', 'MB');

Related

How do I re-use the same image payload in several pages without repeating it?

I'm using tcpdf to generate a report that contains a logo from a svg vector image.
My goal is to efficiently re-use the same image payload over and over in the report, not storing the logo as if it was a different image on each page.
Right now, with the current data, the report generates 32 pages. The file size considerably increases with new pages being added. This seems to be due to the logo being repeated on every page.
I don't have tools to analyze what is inside the pdf but I can see from other reports that are generated by other applications, that the file size of pdfs containing repeated images peaks at 1 page and then on each consecutive page, the size increases very slightly, indicating that the first logo is efficiently re-used.
How can I achieve that using tcpdf?
If in my report, I place the logo only in page 1 and omit it in pages 2 - 32, still outputting all the text data, the file size is greatly reduced, just as in the examples that I mentioned before. This indicates that the svg data is repeated on every page.
From the example 009 in tcpdf's site documentation, I've tried loading the image from file and also tried using a "data stream" (this is encoding the svg in base64 and instead of referencing the image from a file, you use the text-based base64 variable content as a stream that contains the image payload).
I thought that using the data stream would take care of it, but it didn't.
Is there a way to reference the same image over and over in tcpdf?

How to delay until thumbnail created?

I have a vue page that has a file upload component. This allows the user to upload a file to server storage then display a thumbnail of the file uploaded for later retrieval.
The upload works fine and the server creates a thumbnail using imagemagick which is displayed on the page, this all works fine.
My problem is that the creation of the thumbnail takes a second or two which means when the file upload is finished the thumbnail isn't available immediately and I get an "image cannot be displayed" placeholder where the thumbnail should be. Refreshing the page shows the thumbnail fine.
I've jerry rigged things by adding a delay which gives the server time to create the thumbnail but it's a bit hit and miss as some files take longer to generate than others and it seems a bit poor for the user to have to wait 500ms or more before their action is complete.
How do I go about improving the user experience?

Upload same image in different sizes - Dropzonejs

There is any possibility to upload a file with different sizes in DropzoneJs?
I'm using vue-dropzone which is made with dropzonejs and i have to upload the same file with different sizing for srcset.
Example:
I want to upload the file test.png which is 1000x500 px. There is any possibility to upload it at the same time in original resolution and also in 500x250px?
Image resizing in the browser has been a seat-of-the pants experience for a long time. Web assemblies are the way of the future for processing-intensive tasks in web apps. I came across this project the other day. It looks fantastic and I really can't wait to strip out our home-baked image resizing with canvas and replace it with this.
The usual reason for doing this is to avoid large uploads. It's a little bit weird to want to resize in the browser then upload the original. You might be better resizing on the server. You'll save bandwidth and the server libraries will be more mature than what's available on the client.
Along with the original image object you can add one more your custom resized image to the array of images by using resize config of dropzone. You can do the above on drop event or adddedFile event of dropzone.

AS2 fixed sized movieclip

I'm working with a Flash website at the moment, and when clicking on a specific hotspot, it opens up a new .swf over the top. This .swf it opens is styled similar to a Lightbox. It has a (x) to close unLoad the movie, along with a (<) and a (>) to navigate through the images.
The problem being, when adjusting the explorer window, the flash elements scale to the adjusted size, staying in proportion.
What I want is, while it's in the HTML page, is to have only the background flash image to scale, but to have the overlaying 'lightbox' .swf at a fixed width/height, so it never scales according to the size of the user's window.
I've found an example to help with this:
http://newsletters.plainpicture.com/static/newsletters/com/news-1208/index.html
how is your "lightbox" swf implemented? is it an actual html lightbox that acts as a container for an external swf movie? or it's your coded lightbox inside the same swf website movie?
if it is html lightbox then you must provide information about what kind of lightbox it is and perhaps look into the lightbox documentation.
if it's your "lightbox" inside the same flash movie, a possible way to resize a specific part of the same swf but not another is to publish the movie (inside "publish settings", ctrl+12) as non-scalable, and resize only a desired part of your movie manually- via the resize event on the stage listener
var stageListener:Object = new Object ();
Stage.addListener (stageListener);
orig_ratio=Stage.width/Stage.height;
stageListener.onResize = function(){//resized page
something_to_resize_only._height=Stage.height;
something_to_resize_only._width=something_to_resize_only._height*ratio;
//...etc etc... you may include current_ratio/orig_ratio comparison conditions too
}
if you need help with resizing stuff manually, you should create a new question as it is something irrelevant to this question. don't be afraid though, it's not a difficult task and you may even find a lot of tutorials on proportional scaling/resize

Plugin: BuddyPress Activity Plus - How can I call the full size image?

I’m using the BuddyPress Activity Plus plugin and wanted to know if there was a way to call the full size image that was uploaded when viewing the single page of the activity?
I’ve looked at placing a line of code in “activity/entry.php” of the child theme but can’t find anything that will call its full size image, only the thumbnail shows with the link to the full size image to open in a lightbox.
This isn’t what I’m looking for, the full size image needs to be in place of the thumbnail when viewing the single activity page.
Any idea anyone? Sorry if this is the right place for this, just having trouble getting an answer
Many thanks
I'm looking to do a similar thing, not too much luck yet. Also - have you noticed that if you upload multiple images, they stack, rather then laying out side by side?
EDIT:
Found out how to make the images in the stream bigger:
You can set your preferred thumbnail size separately from your default thumbnail size settings, if you wish to do so. You can do that by adding this line to your wp-config.php:
define('BPFB_THUMBNAIL_IMAGE_SIZE', '200x200');
Where "200x200" are width and height (in that order), in pixels.
Finally, be sure to verify your default sizes for embedded media. It's in Settings -> Media -> Embeds -> Maximum embed size