Create node with multiple image fields

I have a requirement to create a node with a REST API. I am using the services module from which I am able to create node of any content type successfully. But here I have added new three image fields which contains upload field type.

With this services api, I want to create node with title body and upload 3 images as well from a HTML form.

How can I achieve this with API.

How do I save an image from twitter.com on a browser?

Twitter apparently doesn’t like the idea of people saving images and other media elements from their feed, because they’ve made it awfully difficult. Things I’ve tried

  • right click hoping for save option (nope)
  • left click hoping for expanded image (nothing happens)
  • inspect element using browser debugger (no obvious img element)
  • search for chrome extension (none that worked for me)

Any other ideas?

enter image description here

how to make a volume with a system image on it the Windows 7 boot volume

I’ve created a Windows 7 x64 system partition image on an empty volume on another drive because the original boot drive was throwing errors and SMART BIOS thinks it is “bad” even though the manufacturer’s utility reports it as in good health.

The image is here:

S:\img\imagename

Is there a simple way to make S: the boot volume, change its drive letter to C:, and take the original drive offline, without having to copy the image somewhere else? I don’t have any free space anywhere to put it, and all the SATA cables are in use.

Reading a QR code from an image instead of a camera

My device does not have a camera, so all those QR code scanners are useless to me.

Is there a way to read a QR code from an image, possibly like an app registering itself as a QR code scanner and it (also) opens image files to scan the QR codes?

I prefer not to use online solutions since those online sites cannot be registered as a scanner.

Why am I getting TypeError “Image data cannot be converted to float”?

When loading images in, I’m trying to make sure they are loaded in correctly by printing them out in pyplot, but I’m having problems. How do I load these images into Tensorflow and check them with pyplot’s imshow()?

The image data is a one-channel(black and white) jpeg. It is initially loaded as a Tensor with an unknown shape and an uint8 dtype. I’ve tried making sure to reshape the Tensor into the correct shape and casting to float32. I’ve also tried making sure the values scaled from 0.0 – 1.0 as a float.

import tensorflow as tf import matplotlib.pyplot as plt  def load_and_preprocess_jpeg(imagepath):     img = tf.read_file(imagepath)     img_tensor = tf.image.decode_jpeg(img)     img_tensor.set_shape([792,1224,1])     img_tensor = tf.reshape(img_tensor, [792,1224])     img_tensor = tf.cast(img_tensor, tf.float32, name='ImageCast')     #img_tensor /= 255.0 #Tried with and without     return img_tensor  def read_data(all_filenames):     path_Dataset = tf.data.Dataset.from_tensor_slices(all_filenames)     image_Dataset = path_Dataset.map(load_and_preprocess_jpeg)     plt.figure(figsize=(8,8))     temp_DS = image_Dataset.take(4)     itera = temp_DS.make_one_shot_iterator()     for n in range(4):         image = itera.get_next()         plt.subplot(2,2,n+1)         plt.imshow(image)         plt.grid(False)         plt.xticks([])         plt.yticks([]) 

Browser: Drag and drop image from explorer replaces content instead of opening in new tab

Drag and drop image from explorer replaces content.

This behaviour can end up cause data loss. Consider this use case: you are filling in a long form and you have a box to upload an images at the end which supports drag and drop. When you dragged an image from the file browser, you accidentally drop the image outside the box in the website.

What should happen?

Browser opens the image I dropped in a new tab.

What happens?

Browser load the image in the page you dropped. Clicking back button will reload the page, making you lose all the data you typed.

Is there a way to stop this from happening?

Transferring a lossless image from an iPhone

asking for a friend. He has an iPhone 5 with a number of crisp photos on it that he wants to move to his computer. However, on moving them to his PC via file explorer, they appear to lose a certain degree of quality. Is this an actual loss in quality or is it just the differences in screens (size, resolution, etc.), and if it is a loss in quality, is there a way to avoid this loss of quality?

Morphisms such that the inverse image of every affine open is contained in an affine open

Is there a name/description in standard terms of the class of morphisms of schemes defined by the following property: the inverse image of any affine open is contained in an affine open?

It should be distinct from affine morphisms (as can be seen by considering the inclusion of affine plane in affine plane with origin doubled).

The reason I am asking is that the stalks of pushforwards of quasi-coherent sheaves could be computed in a certain way for such morphisms.

How to restrict access to image folder depending on whether product is purchased or not?

In WordPress I want to be able to sell sets of emoticons (png images). These sets emoticons are stored in a folder under the plugin (eg. wp-content/plugins/my-plugin/emoticons/set-1/happy.png)

Some emoticon sets are free, some are not. I want to be able to prevent the user from accessing the emoticons if they did not buy the set. Also, because these emoticons are used when writing text I need the check done as fast as possible.

What I tried so far:

  1. loading the emoticons via a proxy php file in which I do the check for user purchases. This works, but it’s awfully slow

  2. using .htaccess inside the emoticons/ folder. With it I do a check like this: RewriteEngine On RewriteCond %{HTTP_COOKIE} .*?emoticonset-(.*)=(.*);? RewriteCond %{SCRIPT_FILENAME}::%1 emoticons/(.*?)/(.*\.png)::$ RewriteRule .* - [L] RewriteRule ^ / [F] It sorts of works in the sense that it will check if the user has a cookie emoticonset-set-1 and if yes then it serves the png image, otherwise it returns 403 forbidden.

  3. I also tried with WordPress rewriting rules, but these only seem to work for redirecting to index.php paths.

Option 2 is extremely fast, but it can be easily fooled by users manually adding the cookie in the browser.

Are there any other options I should look into? Is there any way to make option 2 secure?

How to programmatically add a link to an image field in a view

I have a view with an image field and other fields, and I need to link the rendered image, not the content which is one of the configuration choice, but on another computed filtered view. I think that I should use my_theme_preprocess_views_view_field_myviewname to catch this field, using it’s name as selector then wrap it with the computed link, but didn’t find how to do it.

To clarify my question, the image in this view is normally displayed, and I “dynamically” create a link to another view which is not related to the image. I wrote a function (in my template) to compute this link, and I need to know how to add this link to the image field within my_theme_preprocess_views_view_field_myviewname(&vars). The preprocess function is executed several times to build the view, I tried to use var_dump(vars) to see where is the image field, but it generates a too huge amount of data.