Eclipse standard warning/error overlay icons - eclipse

I'm writing an Eclipse plug-in... In my custom label decorator, I want to overlay a warning icon, and I'd like to use the standard one used by eclipse (the little yellow triangle). How can I get an image descriptor of this icon?
I tried using
workbench.getSharedImages().getImageDescriptor(ISharedImages.IMG_DEC_FIELD_WARNING)
since that ID seems to match what I'm looking for, but the shared images collection doesn't actually have that image in it (so I just get a null returned).
Is there some other shared image collection that I should be looking at?

You have run across an Eclipse bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=304397
The bugzilla entry gives this code as workaround:
ImageDescriptor descriptor =
JFaceResources.getImageRegistry().getDescriptor("org.eclipse.jface.fieldassist.IMG_DEC_FIELD_WARNING");

Related

How to identify that asset added inside Assets.xcassets are used in project?

How to identify quick way the Assets added inside Assets.xcassets for Images & color are using inside project or not.
Example:
int value = 10
In this case int value not used inside application which give an warning.
Initialization of immutable value 'value' was never used; consider replacing with assignment to '_' or removing it
What if inside Assets.xcassets added color or image are not used how to identify ?
Xcode has no tool which could highlight not used assets but there is a open source project called "AssetsChecker" which will do the job.
There's no way a tool can know which assets are not being used by your application.
Imagine that you are creating a Weather app, and the data you receive from the server includes the image_key that you use to know which asset to load.
If a tool to find unused assets was used, it would tell you that every image or color that is not referenced directly is not used, which would yield a LOT of false positives.

typo3 flexslider should user original image and not cropped one

In my typo3 7.6.19 Website I want to user the flexslider plugin.
That works fine, my problem is that the image is a cropped one and not the original file I uploaded.
How can I change it to use the original picture?
Thanks in advance
The plugin sets up a TypoScript constant
plugin.tx_wsflexslider.maxwidth=800px
You can modify this value in your TypoScript template (Module Template > Constant Editor > select "PLUGIN.TX_WSFLEXSLIDER"
About your other problem that is artifacts in the reduced image, I think that when resizing an image from 2550px to 800px, it is probable that the quality will be reduced :) You could check those settings in Install Tool >All Configuration > Image Processing [GFX] and see if you can improve them.
A last word: I would not use images of 2550px, it seems that they will be very heavy! I would try to set a compromise (e.g. plugin.tx_wsflexslider.maxwidth=1200px).
You could also evalutate the extension EXT:image_autoresize https://extensions.typo3.org/extension/image_autoresize/
to automatically resize the images when uploading them and limit the weight or dimensions of the images that your editor will upload.
From this answer typo3 uses crop images how can I avoid this I see that (of course) you can also modify the partial that renders the image and avoid using the TypoScript constants at all, but for the reasons I mentioned above, I would not recommend it.
In TYPO3 10.4.x and ws_slider 0.9.8, it was not a constant but:
<f:image image="{item.foregroundMedia.0}" maxWidth="600" />
in
Resources/Private/Partials/Item/Flexslider.html

TYPO3 Backend displaying image too large

In my TYPO3 7.6.4 when I set up a text & media content element and add a picture it is displayed too large, like its shown in the screenshot
Is there a possibility to fix that? and how?
To make the image procession in TYPO3 work, make sure that
you have installed either GraphicsMagick or Imagemagick on your system
you put the correct path to the binary in [GFX][im_path]. E.g. /usr/local/bin/
you put gmor im6 into [GFX][im_version_5] depending on what you are using.
you set [GFX][image_processing] to 1.
You can change these values in the install tool under "all configuration" in the GFX section.
You should also clear your processed images in the install tool ("Clean up" section) to make sure they are generated with an updated configuration:
Your image processing tests should look like this:
Maybe your PHP is configured to not execute binarys on the server, so ImageMagick can't be launched.
Check "System evironment" in the install tool for some errors or check if the php setting disable_functions containts exec.
if IM/GM is working well (install_tools test are ok) and the thumbnails in file list module are computed correct its the preview in the content elements.
Have a look at the preview definition of your content elements: is the HTML and CSS correct to show the image inside the preview area of that contentelement?

JavaFX 2.2 generated image not shown after building jar-file

In my JavaFX Application I generate a barcode with barcode4j by Apache, save it as png image in the directory /data/images/ and embed it in a web page which is shown on a JavaFX WebView.
After generating the barcode I embend it into the webpage using the following Javascript-Code:
path = "file:/" + path.replace(/\\/gi,"/");
var barcodeElement = document.getElementById("productBarcode");
barcodeElement.setAttribute("src", path );
barcodeElement.style.display = "inline-block";
I use the absolute path C:\path\to\java-program\data\myimage.png and build a file-URL from it.
Using this in Eclipse works without any problems. But when I build my project and start it from my jar-file the image is not shown. But the problem is not, that the path is incorrect or that generating the picture does not work, so that there is some kind of "not found" error. The place where the image should be is just white with a light border around.
And now the strangest part: If you right click on the image and choose "open in new window" the image is shown!
Does someone has an idea about that?
Thank you very much in advance!
My understanding is that the WebView won't let a page loaded with one protocol access files using another one. This makes perfect sense when you load through http://, and forbid file://. Here, you're loading through jar:file:..., and the webview will only let you access jar:file:... resources (I just tried, I can access an image from another jar file, from the same jar file, but not from outside!).
This sounds very much like a bug to me.
One workaround mentioned here is to use "data:" URI (i.e. encode the image directly in the HTML file).

iPhone simulator shows app's images but iPhone does not

I have create an application on iphone using objective-c.In this application i am just displaying different players images stored in one folder, which will be run perfectly on simulator. But when I deploy it on iphone it is not showing the images of the player.
for that the code is:
UIImageView *imageplayer = [[UIImageView alloc]initWithFrame: CGRectMake(imgx, imgy+45,135,150)];
imageplayer.image = [UIImage imageNamed:playerpng];
if(imageplayer.image == nil)
[imageplayer setImage:[UIImage imageNamed:playerjpg]];
if(imageplayer.image == nil)
[imageplayer setImage:[UIImage imageNamed:#"noimage.png"]];
[self.view addSubView:imageplayer];
Plz solve this query.
Thanks in advance
Sometimes xCode doesent update correctly the bundle, try cleaning and building again.
I am currently experiencing this problem as well. I was able to correct it after a bit of debugging and reviewing the build file.
When I do an ls -l, I noticed that some of my png files have a # symbol beside the permissions. When I followed that up with a ls -l#, it showed that the files with an '#' had an attribute set 'com.apple.quarantine'. This attribute is given to a file (often from a zip, jar, or other executable) that is downloaded from the net. You can get rid of this attribute by performing:
xattr -d com.apple.quarantine *.png
Then, select the images in XCode, and check that the checkbox under the target is checked. In my case, it was not, so the images weren't being included in the bundle.
I had the same problem, solved by using all lowercase for the file name in code - image.jpg, but it does not seem to make any difference what case the actual file name is, e.g. Image.jpg
check name of image file. It must be "noimage.png"
not Noimage.png or noimage.PNG
Just to clarify, does the "noimage.png" display, or is the program loading a player image but failing to display it? Or is nothing loading.
These should easily be determined in debug mode.
A few additional things to check...
1) Just for testing, start out with PNG versions of the player files. This is the primary format on the iPhone and might eliminate a file format issue or other anomaly that the simulator is not sensitive to.
2) With regard to fixing in an image editor, specifically make sure that the image is set to a DPI of 72 pixels/inch. The iPhone and particularly Interface Builder are very sensitive to this being correct and will sometimes not display or will display a very blurred version of the image if incorrect.
3) Make sure the image(s) haven't been added multiple times (from different directories and/or to different group folders). We encountered a situation where we had inadvertently imported the same images at two different layers within the project hierarchy and this can cause unexpected behavior within the iPhone (selecting randomly or failing to select).
4) Make sure the Get Info -> Targets has your particular target checked. The simulator may still see the image but it will not get deployed to the iPhone.
5) Make sure you can view the image within XCode and that it looks correct.
Barney
This happens to me sometimes. I once spent half a night trying to figure out what was wrong. In this end, this is what worked: open the image with an image editor and save it again. That's all. I'm using the free Acorn image editor to do this. Haven't tried it with Photoshop. (After all, it seems that Photoshop might be responsible for introducing the error in the first place, although that's far from sure.)
I don't know what causes the problem. I usually get it when I use png files that have been sent to me. Could be a simple file permissions problem, or some more subtle problem with the image format. I would be very interested in hearing the opinion of better-informed people.
In any case, if all else fails just try this: open the image with Acorn, save over the original file. Works for me.
Make sure the image files are added to your XCode project.
After some investigation, Michael's comment seems to have a solved it for me. I had all lower case as the file name but was following variable convention and had the png file with an upper case for the second part of the file name. Here my file was putback.png but was referenced in my code as putBack.png
UIImage *putBackImage = [UIImage imageNamed:#"putBack.png"]; //wrong
UIImage *putBackImage = [UIImage imageNamed:#"putback.png"]; //correct
Select correct target while adding image files to your project. Following are steps to make it further clear
Select Add Files to "YourProjectName"
In opening window there is an "Add to targets" option at bottom that shows all available targets
Check target or multiple targets in which you want to add images
Press "Add" button and you are ready to go