Comments (3)
I understand your request now. This isn't something I'd add to Loupe itself, but the image
method could be overridden to perform the decoding or to return a value decoded elsewhere, e.g.:
const loupe = new Loupe(document.getElementById('demo-1'));
const url = atob(loupe.el.getAttribute('data-enc'));
loupe.image = () => url;
from loupe.
Hi! Based on your example, you should be able to use the data URI scheme to accomplish this; e.g.:
<img src="data:<?php echo mime_content_type('big.jpg'); ?>;base64,<?php echo base64_encode(file_get_contents('big.jpg')); ?>" />
Because Loupe uses CSS background images, a data URI will work just as well for an <a href="…">
scenario as it would for an <img src="…">
scenario.
Does that help you?
from loupe.
I never tried to encode a 20Mpx image but I think cpu usage increase will be big for both server and client, usually this type of encode is used for small images like icons. I only suggested to accept base64 encoded file name/path, not to convert all the file to data:base64.
It's just a suggestion, maybe some other people will want to not reveal the path to the big size image.
from loupe.
Related Issues (12)
- Won't Activated Magnify From Right or Bottom HOT 3
- Not working correctly when window is scrolled HOT 2
- Destroy method doesn't work in v2.0.0 HOT 1
- Loupe does fall outside the limits of the image HOT 1
- Disable loupe? HOT 1
- jQuery 1.4.2? HOT 2
- Update dependencies to fix builds
- [Help] Implementation with Fancybox v3
- Quick movement lag HOT 1
- Any way to turn it off? HOT 4
- Doesn't work on iOS Safari HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loupe.