I need to be able to get a path to images that cached.
While I am wondering if there is a way to do this using SDWebImage, I could probably get away with just having the knowledge to return a path to an image stored in the cache so I can display it within a uiwebview inside an image tag.
According to this https://github.com/rs/SDWebImage/issues/25 it would seem you can simply refer to the image by it's original url and it will be correctly picked up from cache.
Related
I'm currently working on a chrome extension that injects a content script into a webpage that allows the user to autofill a form, and everything seems to be working correctly, with the text inputs. But I have not been able to figure out how to upload an image programmatically (simulating user input).
I need help creating a function that takes in a parameter of image url or data uri, and automatically triggers the file upload as if the user uploaded the image manually, to an input selector of my choice. End result should still keep the thumbnail and similar resolution intact.
Scope:
triggers file(image specifically) input automatically. Must include thumbnail and similar resolution intact
must include a parameter for image url/ or data uri
must include a parameter for input selector I target
must work from a chrome extension content script
must work on any file/image input on any page would be ideal
can be written in javascript or jquery, whichever you prefer
An extension that solves this problem perfectly can be found here, so I know this is possible, I just have not been able to replicate it: https://chrome.google.com/webstore/detail/upload-image-from-url/eiglgndkjiabiepkliiemoabepkkhacb. (the code is obfuscated, so I can't figure out how to replicate.
I need to make a website with an private image inside of <img /> tag, which mean you cannot view it any where outside that website. I need the image to not be displayed even if the user try to copy the src of the image and open it in another tab of the same browser.
Is it possible? If so, how can i achieve that?
Short answer: no. Long answer: not possible :-)
If you can get at it in any way (and you must be able to do that to get it to render in a browser), you can save it locally.
All someone would have to do is access it with a munged copy of a browser that saves all incoming data to disk.
There are ways to obfuscate the image so that the user won't be able to just copy and paste the URL, you can use the Javascript Image object to create a new image and drawImage to draw it into a canvas, however you'll still need to obtain the image data somehow, perhaps making an ajax request for the actual image on the server. However a really persistent user can inspect your javascript code and do some reverse engineering to get the image source.
A more naive user will just take an screenshot of the image and achieve the same effect.
So any attempt to try to prevent the user from copying the image is futile.
I am inspecting a portal's page for loading of images ,its loading very slow.
We pick images from a filesystem , images name from database and read them, create a list and show results using a4j:mediaOutput tag. but the images are being loaded very slowly.
http://www.easyrenting.com/list-detail/3bhk-ardee-city-sector-52/6263
The first problem I see is that all your pictures are high-res (1800px x 2400px).
You really should create thumbnails server side to meet your view requirement and load images according of the size you want to show on the client size.
Have you only verified that your web page weight about 6.5MB including all images? (Check with Firebug).
I would recommand you a custom servlet like this one FileServlet supporting resume and caching with GZIP, and create a URL pattern according to load full res or thumbnail depending of the requirement.
There is no problem using the a4j:mediaOutput tag.
The images are getting loaded slowly because the size is too large, you need to find out a way to optimize the image size. Probably you can re-size the images before saving it to your file system.
Unless you are giving the zoom functionality, you do not need these big images.
That should help!
I'm building functionality that allows users to upload an image, then crop it to a square (for profile pictures etc...)
Currently, the process works like this:
User selects image from hd
Image is uploaded to S3
S3 Path is sent back to view, and image with jCrop is shown
On submit button being clicked, my controller action gets the coords set above
Now I'd like to crop this image to the given coords (note- I'm using lpatters fork of node-imagemagick as it contains 'offset'
Unfortunately, .crop only accepts a path - which we don't have, since it's hosted on S3 at this point.
Is there any workaround?
I saw tmp, but this may be a little overkill?
What about using some of the other entry points such as "resize" that then allow you to provide the custom arguments? I'm using streams in this code: https://github.com/jeffwilcox/4th-cloud/blob/master/lib/webserver.js#L542
I am using CKEditor with Drupal 6.19. I have tried my installation with both CKFinder and IMCE. When an image is inserted from the image browser into the Image Properties window, CKEditor gets a url similar to:
/sites/example.com/files/images/my_image.jpg
I want CKEditor to simply have:
/files/images/my_image.jpg
file structure of my site is this:
/sites/all/modules/ckeditor/ckeditor
/sites/all/modules/ckeditor/ckfinder
/sites/all/modules/imce
/sites/example.com/files/images/my_mages.jpg
Is this url passed from the file browser, or a default in CKEditor?
If it is CKEditor, where do I find the code to change this, or is it even possible?
The URL suggested /sites/example.com/files/images/my_image.jpg is the correct path. Thats because all files are uploaded to the /sites/example.com/files/ folder. The behavior is correct and should not be modified. (Unless I've not understood your problem correctly or there is a very good reason why you want to store your images under DRUPAL_ROOT/files/images)