How to reduce Xcode project file size - xcode

So I am trying to submit my WWDC scholarship app, however the file size limit is 100mb, and mine is currently 132mb. I have spent the past few hours reducing the size of the images, and compressing them, but I only saved about 10mb...
So now I am trying to figure out what is taking up all of the space, and what I can delete to get it under 100mb.
I noticed that when I go into the 'Developer' folder and right click on my project and tap 'Get info', it shows that the file is 132mb, however if I go in and check the three folders individually they only add up to about 40mb.
If I go to ~/Library/Developer/DerivedData then the file for this project is about 250mb, so is there something in there that can be deleted?
Thanks in advance!

~/Library/Developer/DerivedData can be deleted in its entirety at any time. However, doing so will not affect the size of the app.
Looks first at any assets that you have included, images, videos, sounds, data, and fonts. Figure out what can be eliminated, reduced, or hosted externally. Many times you can replace large images with drawing code.

Select your project target > Build Settings, check your VALID_ARCHS:
Remove useless ones, only keep right & less archs for your project, more archs will lead the final archived binary bigger. I think you can only keep x86_64 there in this case.
More reading about the ARCH, you can take a look at THIS ANSWER (it's about iOS).

I finally found the problem. I used the terminal command to uncover hidden files, and found that there was a .git file in the folder which was taking up 93mb. I have now deleted the file and it brought down the size to 37mb.

Related

Working with multiple images in a clockkit complication

I'm trying to put together a complication for my app, I'd like to have it potentially display different images depending on the content of the complication entry but am not sure how best to handle this.
I've got a complication group added to my watch extensions asset catalogue but it only seems to have slots for a single icon in multiple versions, for complication family and device size. I'm presuming this one that is linked to my watch's complication group is only for use by placeholder content, but then as you construct this template yourself I'm not sure why it has this project setting association with a group.
As I would like to add around 10-15 icons to choose from do I need to add multiple complication image sets to my watch app assets? Last years WWDC video on creating complications was early and had them working with images directly instead of image sets, but for the different watch sizes etc I'm presuming image sets are the preferred way to go about this.
Thanks for your help in advance, cheers!
At the moment it seems I'm able to work with normal images that are shared in my app between my iOS app, today widget and watch app. They work ok at the moment, but I'm not sure if they're the right way to go about it as they're definitely not the right size for complications being 30,60, and 90 pixels depending on the scale they're targeting. Still not entirely sure what the complication set is for in the assets as they don't seem to match the image size outlined in the apple guidelines for complications

Prestashop img folder is too big (almost 40GB)

I have a Prestashop store which is getting bigger and bigger, around 40 GB. Recently I have realized that the folder img/ is taking around 95% of disk space. After counting my products and average number of images per product and average size per image I am sure it should not exceed 5GB. Please help.
There is a number of things you can try:
Set write permission on folders and files in img/* directory. It can be
done on your hosting cPanel or by direct ssh access, or any other
way you are comfortable with.
In your prestashop backoffice, go to Preference -> Images. Check if
"Generate high resolution images" option is active. If so, you can
disable it, as it takes very huge space (doubles images folder size)
and it does not help that much as people use laptops and
mobile phones to browse online stores nowadays.
On the same page, at the bottom, Regenerate thumbnails. It will
clear old images and create new ones.
I believe after following these steps you should be able to save a lot of space.
Also, check prestashop addons for image cleaning modules. For example: http://addons.prestashop.com/en/22308-redundant-image-cleaner.html
This module will help you to delete images that are no longer used.
I hope this helps.

Resource pictures not include in directory

I am creating a vb6 application now and most of my command buttons were graphical style. Do the background images still show up even if I remove them from the app folder?
This is part of what goes into .FRX, .CTX, etc. files. Those are resource files created in a private "property bag" type format and are used to hold things like binary data, images, long strings, and so on.
But don't discard your source files, because you may need them down the road. Treat such things as valuable parts of the program source. They are not needed at run time though.
As far a I know it doesn't remove the picture from the command button when you delete it from the app folder, i suggest making a copy of your image and then delete the original and see if it works in case it doesn't you have the backup image, good luck.

Computer-aided remover of already-sorted images

My question is not removing duplicated/similar images. I need a tool to process a more complex process:
Find pictures I have manually removed in a folder
Apply this removal in another folder
Replace low-resolution pictures in a folder by High-resolution ones from another folder
I use Linux, but please propose solutions compatible with several OS if possible. I would also appreciate Free/Libre/OpenSource tools.
The below three examples explain the requirements
-1- Basic example: I have an old copy of my SD card on my computer (where I have already removed failed pictures) and I want these failed pictures (worst ones) be automatically removed from my Camera's SD card.
Folder "My-Computer" Folder "SD-Card" ACTION
I23001.JPG I23001.JPG keep duplicate
I23002.JPG I23002.JPG keep duplicate
I23003.JPG remove missing
I23004.JPG remove missing
I23005.JPG I23005.JPG keep duplicate
I23006.JPG remove missing
I23007.JPG remove missing
I23008.JPG I23008.JPG keep duplicate
I23009.JPG copy new picture
I23010.JPG copy new picture
I23011.JPG copy new picture
In real life, pictures are also copied on mobile phones, web gallery, cloud, backup... and failed pictures may also be removed on different devices...
-2- More complex example: I take picture using camera/smartphone/tablet. I also manually remove failed pictures (worst ones) on computer/camera/smartphone/tablet. We want best pictures being copied an all devices to view/show them.
"My-Computer" "SD-Card" "Smartphone" ACTION
I23001.JPG I23001.JPG I23001.JPG keep duplicate
I23002.JPG I23002.JPG ask user
I23003.JPG I23003.JPG ask user
I23004.JPG remove missing
I23005.JPG I23005.JPG I23005.JPG keep duplicate
P89001.JPG P89001.JPG keep duplicate
P89002.JPG P89002.JPG keep duplicate
P89003.JPG remove missing
P89004.JPG P89004.JPG keep duplicate
I23006.JPG I23006.JPG remove missing
I23007.JPG I23007.JPG remove missing
I23008.JPG I23008.JPG I23008.JPG keep duplicate
I23009.JPG copy new picture
I23010.JPG copy new picture
I23011.JPG copy new picture
P89005.JPG P89005.JPG keep duplicate
P89006.JPG copy new picture
P89007.JPG copy new picture
P89008.JPG copy new picture
-3- Very complex: I copy pictures from my camera to my smartphone using the camera's Wi-Fi access point, but the pictures are reduced (similar image content but not exact duplicate file). I also copy pictures to my friend's smartphone. We also take photos using our smartphone and copy some ones (best ones) to the other smartphone. And we also process the same with tablets. Manual removal is done on any device.
example too messed to be displayed here!
Analysis
List of duplicates finders:
Duplicate file finders on Wikipedia
Search word "duplicate" in image viewer comparison on Wikipedia
Interesting tools:
findimagedups from Jonathan H N Chin, perl script (and C lib) storing image fingerprints into a Berkley DB file and printing together filenames of images matching more than xx% similarity (pictures taken in burst mode may be flagged as similar)
findimagedupes version in Go
gThumb can also find/remove duplicates
Geeqie
imgSeek
digiKam and its Find Duplicate Images Tool
Visipics
dupeGuru Picture Edition
Tools lacking of similar image recognition:
fslint
duff
fdups
rmlint
Coding a new tool
As I did not (yet) find any solution I was thinking of developing a new software:
Modify a command line tools like findimagedups in order to provide the matching distance between images (similarity percentage)
This output may be a graph
each file is a node
edges (relations between files):
content matching (similarity percentage, crop, similar region)
in same folder, in a neighborhood folder
similar filename, successive filename numbering
similar date/time
similar metadata
similar resolution
For each group of content-similar nodes
one folder = one column
one file by raw, if duplicates in same folder (e.g. burst mode)
missing file in one folder = blank
similarity of files are provided in horizontal/vertical neighborhood only
Automatically selection of:
files to be replaced (low resolution replaced by high resolution, except in folder called "small")
files to be removed
User can display pictures and check connection properties

Changing the name of a picture makes the picture looks small

I have a picture. I call it Publictransportation.
It looks smaller than it should be. It looks fine on simulator. But it looks small on iPhone.
I clean build. Delete the application. No luck.
Then I change the pic to Publictransportation1
Now it looks normal.
When I change back it looks small again.
There has to be some false cache. But where?
May be there are two images like one Publictransportation.png present in resources and another one will be just reference of Publictransportation.png, which might me there on your machine.
Search Publictransportation.png in your project and check for duplication.
I guess that you are using the device that has retina display, so you need to rename your picture with #2x in the end in order for the retina to take it as a double size, and from time to time try to clean your project an rebuild it again.

Resources