Comments (22)
Regarding the first issue - try to look in finder and find out the exact dimensions of the 3x image, it might be that only Xcode is showing it that way.
Regarding the 1x recommendation - that's true, however with Blade the use case is regarding a workflow that is not dealing with vector, for example:
If in the past designers used to ship every size factor for imagesets and iconsets to developers (that they resized using sketch, photoshop, or one of their plugins), they now only need to deliver 1 size of the photo - still raster (nonvector), to the developer. From there, Blade will do the cutting of different sizes.
If you're used to working with vector - i believe you should keep doing that, it might be better for your workflow. but you would still have an issue of app icon, where you can't work in vectors. See the previous discussion in #4
Let me know if this make sense
from blade.
FeedIcon@[email protected] => 207 x 207
[email protected] => 92 x 92
FeedIcon.png => 23 x 23
Original FeedIcon@3x => 69 x 69
Bladefile
- source: images/[email protected]
mount: Shoppd/Images.xcassets/FeedIcon.imageset
contents: true
from blade.
So a few things,
- If you start from scratch (meaning FeedIcon is empty and has no images), then blade will generate all images from scratch.
- if you point blade at an existing, let's say partly-filled imageset, it will not override/destroy the images that already exist, and it will try to produce an image that matches the size of the old image that existed there.
So is there a chance that this might be a case of your FeedIcon imageset that was partly filled before you've introduced Blade?
from blade.
That was indeed the problem. Thanks, working great now!
from blade.
Well, now it's back to where it started. When I re-ran het project, the blade process built the files again and reworked the resolution. Same resolution files as reported in previous comments.
from blade.
If the file names are the same, then it means that Contents.json is still there - did you try creating the FeedIcon imageset from scratch?
from blade.
Yes. Deleted everything and then had blade recreate it..
from blade.
Strange, here is an example output from a typical imageset, you can see that the file names has a specific pattern:
-rw-r--r-- 1 Dotan staff 497B Sep 29 23:07 Contents.json
-rw-r--r-- 1 Dotan staff 36K Sep 29 23:07 [email protected]
-rw-r--r-- 1 Dotan staff 288K Sep 29 23:07 [email protected]
-rw-r--r-- 1 Dotan staff 774K Sep 29 23:07 [email protected]
It seems like what you've shown, every file has a completely different pattern, which hints that something isn't configured right. Any chance you can you paste the Contents.json file and the Bladefile verbatim here?
from blade.
{
"images": [
{
"filename": "[email protected]",
"idiom": "universal",
"scale": "1x",
"size": "23x23"
},
{
"filename": "[email protected]",
"idiom": "universal",
"scale": "2x",
"size": "46x46"
},
{
"filename": "[email protected]",
"idiom": "universal",
"scale": "3x",
"size": "69x69"
}
],
"info": {
"author": "xcode",
"version": 1
}
}
blades:
- source: images/[email protected]
mount: Shoppd/Images.xcassets/AppIcon.appiconset
contents: true
- source: images/FeedIcon.png
mount: Shoppd/Images.xcassets/FeedIcon.imageset
contents: false
Both contents: true/false
appear to do the same thing. First build on an empty imageset is working fine. Subsequent builds messes things up.
Contents.json doesn't change size values, while the images are in fact bigger.
from blade.
So the Contents.json
you have pasted looks good. It should look OK on Xcode too, doesn't it?
As an aside, you should probably always do a contents: true
, this means Blade generates a new Contents.json every time and not only new files.
Is it possible that the old files exist in this imageset? or some kind of process brings them back (git perhaps?)
Im still not sure what you are experiencing that is incorrect, I'm trying to re-read your first post, but so far everything you're doing looks ok
from blade.
I did what you said: contents: true
and delete all files in the imageset, also checking if the files were deleted in Finder as well. Same result.
I'll try to explain it as clear as possible, sorry for my previous, messy explanations.
First build: images created, everything OK as it should be (correct sizes and correct Contents.json
).
Second build: images recreated, different sizes, as if the original resolutions as scaled up again, Contents.json
still correct.
Build phases rule:
Shell: /bin.sh
./blade
./blade is the binary from the latest release located in the root of the project (same as .xcodeproj file).
from blade.
I see, this is very strange. Can you try to use the demo project to reproduce? I don't think this is ever happened. The demo project is here, should be 5 minutes to test out:
https://github.com/jondot/blade-sample
from blade.
Same thing happens with the sample project.
I created a new imageset and added the image to the bladefile. AppIcon seems fine.
from blade.
Hold on, I'm recording a video of myself using blade on the sample project, including an image set. Maybe the steps are different.
from blade.
Take a look at this, see if anything here looks different:
https://youtu.be/fX1KEquUH-o
from blade.
https://youtu.be/U72jlWlLve0
Somewhat the same steps we take. So this is some weird behaviour. Could be my settings, but the demo project has the same problem.
https://dl.dropboxusercontent.com/u/59237165/blade-sample-with_buildstep.zip
That's the project with my settings. Maybe try and run this on your system and hopefully you'll be able to reproduce the problem. Might help figuring out what is going on..
from blade.
Good news! I'm able to reproduce. Initial examination showed nothing, I'm not yet sure if this is the project setup or a glitch in blade, so I'm going to go a bit deeper. Hope I have results today or tomorrow!
from blade.
Me neither. But I know for sure that I was able to reproduce it in both my normal project and the demo project. So it's not something in the project settings, I think. It must be either the bladefile config (not likely, there is not a lot in there), the image file(s) itself or a real glitch. Maybe tomorrow I would be able to examine everything and maybe help with finding a solution. Never worked with Go, but I'm sure that won't be a problem.
from blade.
Yep, I think I have initial theory, and it is in the "size" property. So the direction now is in a size conversion glitch within Contents.json
from blade.
Should be good now - see commit message above :) . Can you try the latest build? (either from Homebrew or releases on this repo)
from blade.
Working great now!
Thanks for fixing it. This is making my life so much easier..
from blade.
yay! 👍
from blade.
Related Issues (11)
- it's Xcode HOT 2
- Does Blade maintain directory structure in the xcassets folder? HOT 1
- Supported input formats? HOT 6
- Manage existing image files HOT 5
- Incremental builds HOT 2
- Support iMessage Extension & Sticker Pack icons HOT 2
- blade fatal error: fault [signal 0xb addr=0xf3201307c33 pc=0x13f732] HOT 6
- iPhone and iPad Notification have not automatically generated
- Blade vNext HOT 6
- Add support for custom output size
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blade.