iOS: Find out if an image is used in some xib - ios

I want to find out which images in the project are actually used. When I try to find names of images that were set programaticly, I can see them in the relevant classes when searching. This is not the case for images that were set in the xib. Is there some workaround to find if the image is used in some xib?

Try using the utility app Unused by Jeff Hodnett. I've used it before and had success with it.

You can from the command line, yes.
As always, grep is your friend:
$ cd ~Source/Books/Beginning iOS 6 Development/ch04/Control Fun/Control Fun/en.lproj
$ grep png *
BIDViewController.xib: <string key="NSResourceName">apress_logo.png</string>
BIDViewController.xib: <string key="NS.key.0">apress_logo.png</string>

Related

iOS SceneKit: XCode "breaks" imported DAE material colors

First of all, I apologize if for the non-technical language regarding 3D design, it's out of my scope.
I'm using some DAE files for displaying 3D models on SceneKit, provided by a 3D designer. However when I add it to the scnassets folder on XCode, all material colors get "corrupted". Take for example this DAE for a jewel, the blue and white version is visualized on an online viewer and is the correct one. The other black and white is a screenshot I took from my phone running an ARSession with the dae loaded on a node.
Any idea on how I can preserve the original colors?
Update Running from the command line I get lots of this warnings:
$ xcrun scntool --convert ARO-E-BLING.DAE --output cliConverted.scn --format scn
Warning: The instance_effect with URL file:/Users/Leandro/Documents/ARO-E-BLING.DAE#White stone-fx does not reference an effect, skipping it
Warning: The instance_effect with URL file:/Users/Leandro/Documents/ARO-E-BLING.DAE#Blue Stone-fx does not reference an effect, skipping it
Warning: Found an invalid material [White], reverting to a default material
Warning: Found an invalid material [Blue], reverting to a default material
Well, running it from the command line helped me find the solution. It seems scntool fails if materials and/or effects in the dae have whitespaces on it. For instance I had things like:
<material id="Blue Stone" name="Blue Stone">
<instance_effect url="#Blue Stone-fx"/>
</material>
which I had to replace for
<material id="Blue_Stone" name="Blue_Stone">
<instance_effect url="#Blue_Stone-fx"/>
</material>
UPDATE Jan 8 2018 I submitted a bug report to Apple and they stated that this behavior is not a bug stating that:
According to the Collada spec
(https://www.khronos.org/files/collada_spec_1_4.pdf) the URL of an
"instance_effect" is of type "xs:anyURI".
URIs are not allowed to contain space, they must be escaped ("Spaces
should instead be escaped using %20" in
http://www.datypic.com/sc/xsd/t-xsd_anyURI.html).

Spanish chracter and some spaceial chracter not allowed in Imagmagick

Spanish chracter and some spaceial chracter not allowed in Imagmagick when creating images from pdf.
There is showing error message "no decode delegate for this image".
Can i ignore that text while creating images from pdf.
Any solution for this?
Thanks!
Try running the following:
convert -list configure | grep -i "DELEGATES"
What does that mean?
**convert -list configure** - displays your imagemagick configuration
**grep -i "DELEGATES"** - takes the results from above and does a case insensitive search for what you're looking for, in this case, you're looking for the section marked DELEGATES
This should return all of the packages that you need in order to run your command.
Using your favorite package manage ( apt, yum,brew, etc ), install those packages ( including their development packages ), then try again.
Here is a thread you can check out, where someone had a very similar issue:
http://www.imagemagick.org/discourse-server/viewtopic.php?t=22488
Hope this helps!

Why does the search results change after PDF optimization in Ghostscript?

When searching for the word find in the PDF file in this Link before Ghostscript optimization the results will give pages number 4,7 and 13 but after the optimization it gives only pages 4 and 13 ignoring page number 7, the script im using for the optimization :
D:/gswin64c -sDEVICE=pdfwrite -dMaxSubsetPct=100 -dAutoRotatePages=/None -dMaxInlineImageSize=0 -dPDFSETTINGS=/ebook -dColorImageResolution=96 -dDetectDuplicateImages=true -dColorImageDownsampleThreshold=1.1 -dDOPDFMARKS -dUseTrimBox -sOutputFile="D:/temp/search_text.pdf" -dNOPAUSE -dNOGC -dBATCH -dNumRenderingThreads=8 -c 50000000 setvmthreshold -f "D:/temp/iphone_user_guide.pdf"
I've tried to add several fonts related parameters to the script such as -dEmbedAllFonts=true and pointing to fonts path also I've tried to play with the parameters by eliminating some but with no result
what could be the cause of this problem?
Ghostscript doesn't do 'optimization'. See my answer here:
GhostScript issues with a CropBox
for some details on what it does do.
Wihtout seeing your file I cannot tell you for certain what the difference is, but most likely the missing text has been drawn as images instead of text for some reason.
By the way, a lot of the options you are sending have absolutely no effect (eg NumRenderingThreads, for a device which doesn't do rendering). You should NOT select -dNOGC, that's a really bad idea, -dDOPDFMARKS is already set for the pdfwrite device.

TCPDF - How to generate a TTF file from PHP?

I am using TCPDF 6.0.20, PHP 5.3.8.
Since my PDF will contain some Chinese Character (Simplified and Traditional), I decide to use font name: cid0cs.
Now, since a lot of users replied that they don't have that font installed, I need to embed this font to the PDF.
However, in http://www.tcpdf.org/fonts.php it says how to embed a TTF file using addTTFfont(), but NO WAY to create that font.
The only file that I found in tcpdf/fonts/ is cid0cs.php, which is NOT a TTF file.
I tried to run the script in tcpdf/tools/tcpdf_addfont.php and use the command line below:
c:\tcpdf>php tools/tcpdf_addfont.php -t CID0CS -o . -i fonts/cid0cs.php
and it returns:
--- ERROR: can't add fonts/cid0cs.php
How can I create the cid0cs.ttf file so that I can embed it using addTTFfont()?
I found the solution and record the process in my blog post below:
http://alucard-blog.blogspot.hk/2013/06/tcpdf-how-to-display-chinese-character.html
The key point is: I found the font that can display Traditional and Simplified Chinese.
cmd and run php
run this command : \ABSOLUTE PATH TO\tcpdf_addfont.php -i \ABSOLUTE PATH TO\myfont.ttf
if it works fine, you will find 3 files of myfont in /TCPDF/fonts
you might find some help here : http://queirozf.com/entries/adding-a-custom-font-to-tcpdf

How to specify a method in pngcrush?

I am optimising a whole directory of images with 10000 png images. I did use the brute to test and for the first 100 it was method 11 is the best for compression.
You know that pngcrush uses like 130 different methods to try on an image and this is really taking too long.
I did try to input -brute -m 11, but this will let it start from 11 and go up.
I only need method 11 to be applied.
Here is my script :
#!/bin/sh
for png in `find $1 -name "*.png"`;
do
echo "crushing $png"
pngcrush -brute -m 11 "$png" temp.png
mv -f temp.png $png
done;
Any idea how to work around this and only apply method 11 ?
btw pngcrush works best with my images so please don`t suggest optimisers like pnggauntlet or pngoptimizer.
Thank you all
Kind Regards
My bad ... I shouldn`t have used the -brute command and it should have worked :-)

Resources