Forbid the user to open image in the new tab (Rails app) - ruby-on-rails

I display the image in my Rails app like this:
= link_to image_tag(image.url), image_path(image.id)
I want to forbid the user to open this image in the new tab.
How do I achieve this?

You have multiple options:-
Disable right click - but users can still get the url of the image through source file.
Set the image as background of an HTML element - but it also has the same limitation as the first problem.
Use image manipulation software such as imagemagik etc to redue size and quality of image.
Add watermarks using image manipulation software like imagemagik.
How to use imagemagik
How to add water marks using imagemagik
There may be many more solutions
This answer is specific to your comment to address copyright issue.
For disabling right click see this page:-
https://www.conceptinfoway.net/disable-right-click-on-particular-element-like-textbox-text-area/

Related

How do you change the icon for an automator app?

I have created a simple application for my Mac using Automator. I am trying to change its icon from the default robot icon, but anything I try does not work. I have tried copy-pasting the image I want using the Get Info technique, but that didn't work. I also converted the image I want as my icon to a .icns file and put it in the resources folder inside the package contents folder for the app. I also renamed that icon to AutomatorApplet.icns. This technique did not work either. Are there any other techniques I can try, or am I simply doing something wrong?
The copy-paste technique actually works. The one thing I realized I missed is to select the image. You need to hit command-a to "select all" before you can copy the image you want to use as your icon. Then to paste the image onto the app/file you want to have the image as an icon for, just select the item and hit command-i. The get info panel opens and you will need to click on the icon on the top left. Hit command-v and your new image should be used as an icon.

How to insert image in Tableau worksheet

anybody know how to insert image in Tableau worksheet and doing the hyperlink?
i only can add image in dashboard, and in dashboard i also cannot use the image as hyperlink.
From the Tableau on-line help
You can add static image files to the dashboard. For example you may
want to add a logo or descriptive diagram. When you add an image
object you are prompted to select an image from your computer. You can
also type a URL for an image that is hosted online. When you add an
image to a dashboard, you can customize how the image displays by
selecting an option on the images's menu. For example, you can select
whether to Fit Image, which scales the image to the size of image
object on the dashboard. You can also select whether to Center Image,
which aligns the image to the center of the image object on the
dashboard. Finally, you can Set URL, which turns the image into an
active hyperlink on the dashboard.
One of the easiest way to add image into dashboard as
To add image as hyperlink Go to dashboard Icon > Action > URL and in that paste your link as
Tableau image management is still a bit basic, and it's only available in dashboards.
Images can be copied into a dashboard by referencing an external URL in a web object, or a local file path.
You can then use the image object's menu to set a URL to open by clicking on the image.
When clicked, the web page will open in your default browser.
You can also add visuals to dashboards by using a web object to reference a URL - which might give you a more dynamic option, depending on your requirements.
There's a gotcha in Tableau sServer with that approach though - if a report is subscribed to, under the scheduler, a web object just renders as blank in the PNG file that gets emailed. This is also true for manual exports (e.g. to PDF) from Desktop.
So if you want to print/ export your dashboard with images, the image object is the best way to go.
To add an image in a worksheet, you need to use Marks Shape.
This is the process:
1.- Copy you image file to a folder in C:\Users\<username>\My Documents\My Tableau Repository\Shapes\My Image
Note that you need to create the folder My Image
2.- Create a calculated field with the formula: image
3.- Drag that calculate field to Rows shelf
4.- In Marks card, select Shape
5.- click on Shape button in Marks card and click on More Shapes....
6.- In dialogue Edit Shape, click on Reload Shapes, then select the Shape Palette My Image and select your image as a shape
Click on OK
Regulate the size of the shape on the view using Size button on Marks card
You can take advantage of the capacity of adding images to a dashboard. It a simpler approach.
In this case, you only need to create a dashboard and click on Image object (left-side of the dashboard) and select the image file in you disk. As a result the image in embedded in the dashboard.
Credits: Ramon Martinez on tableau community
Hope this helps.

How to restrict right click option on the image?

I m designing my portfolio in ruby on rails. In order to restrict the image from being copied, i wanted to disable the right click and other features of copying an image from the website. How to do it?
In most modern browsers you can disable the right-click menu for a particular image. To do so, you can use the event handler oncontextmenu="return false;" within the IMG tag that defines your image:
<IMG border=0 src="..." oncontextmenu="return false;">
For example, the context menu has been disabled for this image:
Note: In older browsers (e.g. Internet Explorer 4.x or earlier) this trick won't work. Also, the context menu will show up if the user has disabled JavaScript.
As all others already said: It's not possible in a reliable way. Only thing you can consider is to watermark your images.
You can disable the right click with javascript.
However, this is a pretty bad idea.
Since your images are sent to the browser of the visitor, they will be accessible, either by displaying the source or analyzing the HTTP requests, in the cache files, or simply screenshoting.
You should not break the user navigation by disabling the right click, your images will be copiable and there's nothing you can do about it. Deal with it.
Sadly its not possible to stop people from copying an image on your page.
Simply disabling right click would not be enough, anyone could just view the source to see the image url
http://www.hypergurl.com/norightclick.html
This guy has mentioned that we can add a transparent gif image to restrict the copy function but i am not getting how to do it. I m displaying my images inside carousel. And carousel gets very tricky sometimes. Also ive uploaded my images in cloudinary so if a person can get the URL of an image then he needs certain parameters to access it which only the owner has.

How to get the Preview image using advImage plugin in Rails application

HI ,
i am using Tinymce with advimage plugin in my rails application.
I have doubt that When i click on the Insert/Edit iamge in the Tinymce a popup window comes and in the appearance tab the preview is not shown
How to get the preview image ?? in the Appearance tab
There are two "previews" in the Advanced Image plugin dialog. The first is the preview of the image you have selected. The second is to allow you to visualise what the style changes you make (for instance border, alignment) would look like and uses an "sample" image.
I assume what you would like to see is your selected image displayed instead of the "sample" image. To achieve this, you will need to alter the advimage plugin, which is bundled with TinyMCE, to use the currently selected image instead of the default (sample.gif).
One thing to consider is that if your end user selects a large image, then they wouldn't be able to see the application of the style changes within the small preview window.

Changing an image doesn't work

I have downloaded a MVC project from an Open source and I am trying to make it my own.
I want to change images and add different things, new pages etc...
When I am changing an image in the content folder (for example the logo appearing at the top of the master page) it is always showing the old one.
If I change the name to logo1 for example I can see the new logo but as long as I am using logo the old logo is showing even if I changed the image.
Do you have an idea of what is going on!
Thanks
The browser is caching the image, clear the cache and you should see the new image.

Resources