Is there a plugin out there that will take an image that is uploaded and resize it to a smaller size so it doesn't fail in the upload process. Basically I have a need for an avatar and the users are uploading various images that are huge from their digital cameras and they tend to be about 2mb or bigger which causes the script to fail... Is there a jQuery plugin that can help me out? I kind of want if to work like the Facebook uploader where it doesn't fail. Any ideas?
By the way this a ColdFusion script, but my expertise is not in ColdFusion so I was hoping jQuery could help.
Javascript cannot resize images. For that you'll need Flash or java.
Flash upload image resize client side
Or you could do it in PHP and use GD to resize images. Don't need active x or flash or anything else but notepad and a php enabled server.
There are some JS scripts that do this for you, but they usually use Flash in the background to do the resizing.
Checkout SwfUpload or PlUpload.
As mentioned you can't resize images client-side.
I've successfully used IglooLabs jquery Plugin (http://www.igloolab.com/jquery-html5-uploader/).
I edited their plugin to do client-side file size (<2MB) and type (jpg, png etc) checks before allowing upload. I can provide edited plugin if you want...
On Upload to the server you can then do an image resize using two lines of code e.g.
<cfimage action="resize" height="" width="750" source="/img/image_to_resize.png" destination="img/resized.png" overwrite="yes" name="resized_image">
(Be warned thought that ColdFusion has a bug resizing some jpeg images. Best to convert to .png first)
Related
I have copied the image plugin to customize it upload video, which is working fine.
but when I select upload - it defaults to selection of image files, I tried searching everywhere, but couldn't find,how I can change this to type mp4 or of type video files.
TinyMCE has the Media plugin which allows you to natively upload video and audio files. It should work without any customizations to the Image plugin, thus - safer. However, to be able to upload something other than images, you will need to add a file_picker_callback that will handle uploads.
I have a PDF file being viewed on the browser.
I want to disable Save, Download and print option of the PDF file.
Please help.
Try this:
<object width="100%" height="100%" type="application/pdf"
data="yourpdffile.pdf#toolbar=0" id="pdf_content"><p>Document load was not
successful.</p></object>
Make sure you add #toolbar=0 in the data attribute after your pdf file.
You can use iframe to your own version of PDF viewer.
Use pdfJS and when showing viewer.html just remove these buttons.
If user is viewing it on it's own tool, than you can't control it.
Google Drive can disable the PDF functions to download, print and copy as of 2015.
Note however, that users can still print using the browser print function.
https://gsuiteupdates.googleblog.com/2015/07/disable-downloading-printing-and.html
As others have noted, once the pdf is being viewed by the user, they can save it.
If you are just wanting to obfuscate the download, you could disable the menu as described but to truly prevent downloading of the PDF, then only thing you could really do is a little crazy but not impossible.
You could convert it to images and show those instead. Not an ultimate solution as they would still be able to save each image, but at the very least they would not get a PDF file from it (or at least if they are smart enough to convert the images to one, it would not be the same pdf file or content)
There are many tools to do this and you'd have to implement a viewer with paging but this might achieve what you want.
Hi,
I have a banner on my site made in flash. Its an animation that ends with a sequence showing buttons which the user can click to navigate to inner pages. Since flash seems to be dead soon I would like to replace that with html5 friendly code. Is it possible to have a program such as Adobe Flash CS5 to convert the full movie for me into javascript code? Or I have to write the javascript all by myself from scratch?
Thank you.
You can use Flash CC to publish you flash file into HTML canvas base structure. Steps -
Open file in Flash CC select commands->Convert to other Documents.
Folder Select HTML 5 Canvas from Dropdown and press OK. Now open
newly created Flash file and publish. It will give you the canvas
base html file.
The html and javascript you get is in organized format and you can even edit code as well.
Hope it solve your problem.
When using Chrome mobile on iOS and Android, we noticed that when "Reduce Data Usage" is turned on, the images on our modelling agency website get compressed by a significant amount. We would like to somehow disable this, since our portfolio has to consist of high quality photos.
Is there any HTML meta tag, CSS rule or any JS hack to force disable this function?
try <img src="example.png" pagespeed_no_transform> where
The 'Optimize Images' filter won't optimize an image (though it might still cache extend it) if it has the pagespeed_no_transform attribute.
Use some jquery
For example
$(document).ready(function(){
$("img").attr (" pagespeed_no_transform",true );
});
I'm having a bit of trouble using the retina.js script. I'm trying to swap the logo for a retina image on this page:
http://mikeleachcreative.co.uk/comps/fmp-mobile/
The script is included as instructed and there are definitely images included with the required '#2x' extension, you can view these images here to make sure:
http://mikeleachcreative.co.uk/comps/fmp-mobile/images/fmp_mobile_logo.png
add #2x onto the end of the filename to see the high-res version.
When this page is viewed on a retina device, I am still seeing the lower-res image, any help would be greatly appreciated.
Thanks.
It looks like (whenever the #2x image is checked) your server is returning 403 (not authorized). Check the settings on your server. Retina.js requires you to be able to make a HEAD request to the server (not GET or POST).