How to increase the visible size of custom-icons of folders and symlinks in Nautilus, the Gnome file manager? - icons

Assume the custom icon is a photo of size e.g. 512 x 512. I'm not talking about zooming in nautilus with Ctrl+mouse wheel, but rather of the size of custom icons relative to the size of thumbnails. The visible size of thumbnails of regular files with image data can be increased e.g. via:
gsettings set org.gnome.nautilus.icon-view thumbnail-size 256
When I do this for regular files, how can do the same for the visible size of custom icons of folders and symbolic links? At the moment my thumbnails are large and the custom icons are small, which looks asymmetric and also does not allow to recognize details in the custom icons.
Example:
#!/bin/bash
image=/usr/share/icons/hicolor/512x512/apps/gnome-chess.png
cp $image .
mkdir dir1
ln -s dir1 link1
gvfs-set-attribute dir1 metadata::custom-icon file://$image
gvfs-set-attribute link1 metadata::custom-icon file://$image
nautilus . &

Related

How to set PIL saved image "content type" as 'image/jpeg'?

I'm reading an image with PIL, resizing it, and saving again as jpeg, as such:
img = np.array(Image.open(filename))
# I'm using TensorFlow for resizing, but it doesn't matter
resized_img = tf.keras.preprocessing.image.smart_resize(img, (335, 335))
resized_img = Image.fromarray(resized_img.astype('uint8')).convert('RGB')
resized_img.save(f'thumb/{filename}_thumb', format='jpeg', quality=70)
When I upload it to Firebase Storage and I try to access it with the direct link, the file gets downloaded instead of displaying the image, which is something I don't want.
It can be viewed locally normally. But the Type is shown as application/octet-stream at the console, and it can also be displayed normally with <img> tags.
EDIT: I could solve the content type problem by using
gsutil -m -h "Content-Type:image/jpeg" cp -r . gs://mybucket.appspot.com
when transferring the images. But the problem isn't solved, the images continue to be downloaded automatically when accessed with the direct link.

How to set Plugin Header image on wordpress.org

I have developed a plugin for school project to parent login/register and uploaded on WordPress plugin directory, but i am not able to sat banner image on top.
Please guide me if have any idea.
Please check this link. You will find your solution.
Source: https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/
To Add a Plugin Header Image:
Make a 772×250 pixel JPG or PNG image file. (No animated GIFs. :) )
Check it in to your plugin’s SVN directory with the path assets/banner-772x250.(jpg|png). Note that the assets directory is added to your plugin’s root directory, not trunk.
On the next plugin directory refresh (every 15 minutes or so) you should see your image start showing up on the page.
For an example of this in action, check out Hello Dolly or Pluginception for HiDPI action.
You can also make larger images, which will be used on high-DPI displays (aka ‘retina’). To do so, make a second image with the size of 1544 pizels wide and 500 pixels high. This file will be named assets/banner-1544x500.(jpg|png). Note that you can not make this image alone, it only works as an “add-on” to the 772×250 image, because this larger image is only used on displays that can show the higher detail.
To add a plugin header image in the new directory:
Make a 1880×609 pixel JPG or PNG image file. (No animated GIFs. :) )
Check it in to your plugin’s SVN directory with the path assets/banner-1880x609.(jpg|png). Note that the assets directory is added to your plugin’s root directory, not trunk.
On the next plugin directory refresh (every 15 minutes or so) you should see your image start showing up on the page.
Unlike the old plugin directory, no other plugin banner is required.
Another thing to consider is the case for the international plugin directories. Some of these, like Hebrew and Arabic, use Right-To-Left languages. In these cases, the title will be overlaid on the right hand side of the image, not on the left side. Generally it is best to design your banner such that the title can be in either position. However, this may not work with all designs, so if you need to have a different image for RTL pages, then you can do so. Make the images in the same way as before, but name them with -rtl appended to the name. So an RTL banner would be named assets/banner-772x250-rtl.(jpg|png) and assets/banner-1544x500-rtl.(jpg|png) or assets/banner-1880x609-rtl.(jpg|png) for the new directory. On RTL pages, if these images are available, then they will be displayed instead.
After you check in your new banner(s), it will appear the next time the plugin refreshes itself in the directory. This may take a few minutes.
For development and testing, you can add a URL parameter to your plugin’s URL of ?banner_url=A_URL_TO_YOUR_IMAGE to preview what the page will look like with your own image. This will only work with your own plugins; you cannot use this parameter on anybody else’s plugins.

Getting Titles of images while using WGET

I am downloading images using wget for a learning project which i am succcesfully able to do. However, some sites have all images titled with the same name - in such cases, is it possible for wget to read the title of the images in the page and output the images with the title name ?
For example if all the images would by default be saved as 1.jpg I would like them to be saved as .jpg where ImageTitle is derived from the Title of the image.
Thanks.

WordPress generating empty files for certain image_size's

Running into a weird situation where WordPress generates all the proper files for the various image sizes, however is generating an empty file for two of the bigger image_sizes. Here's a screenshot of the files that are being created. You can see that the two highlighted files in that screenshot have a file size of zero.
Here's the WordPress code for my image_sizes:
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size(380, 280, true);
add_image_size( 'ms-feature-downsized', 1260, 700, true);
add_image_size( 'ms-feature', 2000, 1111, true); // creating empty file
add_image_size( 'ms-cover', 2000, 3000, false); // creating empty file
This is unique to this installation. I've tested the same theme and images locally, with the same plugins, and the images get properly created.
The server WordPress is running on has the following setup:
PHP Version 5.4.28
memory_limit: 256M
upload_max_filesize: 64M
imagick module version: 3.1.0RC2
ImageMagick version: ImageMagick 6.7.6-8 2012-05-02 Q16
GD Support: enabled
GD Version: bundled (2.1.0 compatible)
Any thoughts on why these image sizes are being created as empty files?
This unfortunately will not necessarily solve your problem but its helpful and worth knowing.
For all the crop sizes specified in your theme that are larger than that of the image size being uploaded, WordPress will skip over these and not process them.
This applies for both width and height, the image being uploaded must be both as tall and as wide as the specified crop sizes to be processed and cropped. Any smaller than your specified crop sizes and it wont be cropped.
Logical - crop is there to make the image smaller, not to stretch and make it bigger.
In the case that WordPress does not process and crop this image because it is smaller than the set crop size and you are calling it in your theme or plugin, WordPress will return the original image uploaded as a fallback.
Hope this helps you or someone else at some point...

Xcode Organizer error. High RES Icons for Mac App 1024x1024 can not be validated

Xcode 4.5
Mountain Lion
Method : letting Xcode automatically create ICNS format from an iconset folder
When I validate in Organizer for the Mac App Store, I get the error:
The Application bundle does not contain an icon in ICNS format, containing both a 512x512 and a 512x512#2x image.
Both icon files are contained in the HM_MAC.iconset folder.
Both icons are produce in PhotoShop using Export for Web Device option. Both
are exported from a photo shop image that has 1024x1024 pixels.
I notice that in the file Info windows for the two icons, under 'More Info'
just after creation it shows:
Dimensions: 1024 x 1024 and 512 x 512
Then later, when I check the same info I see
that the
Dimension area for the larger 1024 x 1024 icon is BLANK.
Image showing file info for icons:
http://www.flickr.com/photos/79640605#N04/8281909148/in/photostream/>
In Xcode, after adding the iconset folder to the project, if I click
on the iconset folder, the icon appears with a slider beneath. If
I slide the slider, the maximum size displayed at the lower right is 512.
To restate the problem. I have 10 PNG files that I need to put into an 'iconset' file
All ten files share:
RGB with no Alpha
all produced by PhotoShop CS4 which shows the size: 1024:1024 for source file.
The two largest of my ten files are :
icon_512x512.png
icon_512x512#2x.png // necessary for MBP Retina screen
Finder's GetInfo View can display the dimensions of all these PNG files
except the largest, i.e., icon_512x512#2x.png
If I open this largest file in iPhoto, iPhoto can display the dimensions
correctly, namely, 1024 x 1024 and size 280 kB
What is causing Finder to fail to calculate the file size? Whatever it is,
the same thing is perhaps causing myApp to fail validation in Organizer.
Has anyone encountered this problem?
Thanks a lot.
There are currently 10 icon files from 16x16 to 1024x1024 required for an OS X app.
For example icon_16x16.png .
I created an iconset file/folder with these 10 PNG files.
I then dragged the file, myApp.iconset to the Resources group folder of the Xcode project.
When I clicked on the iconset, the icon appeared in Xcode with a slider bar beneath.
As I slid the slider, the size displayed changed from 16 to 512. 1024 was no where to be seen.
When I archived the project in order to distribute to Mac Store, I got an validation error
indicating I did not have both 512x512#2x and 512x512 files.
Xcode is now supposed to automatically create an ICNS file from an iconset at build time.
It did not seem to work on my iconset.
Then I took the same ten PNG files and created an ICNS file from them. In terminal I used iconutil .
See : man iconutil
It created an ICNS format package named myApp.icns which I put in Resources/ folder. Then set CFBundleIconFile to 'myApp.icns' in
Target -> Build Settings
Everything is working now.
"The Application bundle does not contain an icon in ICNS format, containing both a 512x512 and a 512x512#2x image."
When working on a free-version, I renamed <string> for "CFBundleIconFile" entry and had a typo so it pointed to a nonexisting .icns file. In that case you get the same error - so be sure to verify that one too if you run into this issue.

Resources