Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'images-resize' task moves images #233

Open
wiseman opened this issue May 14, 2019 · 8 comments · May be fixed by #235
Open

'images-resize' task moves images #233

wiseman opened this issue May 14, 2019 · 8 comments · May be fixed by #235
Assignees

Comments

@wiseman
Copy link
Contributor

wiseman commented May 14, 2019

The images-resize task puts all resized images in the out-dir ("public" by default), which was surprising to me.

I use subdirectories to organize content, keeping images and pages together. E.g.

resources
├── 2019-05-01-figuring-out-whats-overhead
│  └── 2019-05-01-figuring-out-whats-overhead.md
└── public
   └── 2019-05-01-figuring-out-whats-overhead
      ├── 3ff1.png
      └── vrs-options.png

If I don't use the images-resize task, this generates the following structure in target:

target
└── public
   └── 2019-05-01-figuring-out-whats-overhead
      ├── figuring-out-whats-overhead.html
      ├── 3ff1.png
      └── vrs-options.png

The images are copied to the corresponding location in target.

If I add this task:

(perun/images-resize :resolutions #{800})

I end up with this structure:

target
└── public
   ├── 3ff1_800.png
   ├── vrs-options_800.png
   └── 2019-05-01-figuring-out-whats-overhead
      ├── figuring-out-whats-overhead.html
      ├── 3ff1.png
      └── vrs-options.png

It seems like images-resize changes the default behavior that files will be copied to a location in target that corresponds to their location in resources. This feels surprising and less useful than putting the resized images in the corresponding output locations for the original images.

I understand a potential workaround would be to specify :out-dir for the task, but I don't know how to do that without adding a separate images-resize task for each subdirectory, which feels somewhat onerous given the default behavior without images-resize doesn't require any per-subdirectory tasks.

@allentiak
Copy link
Contributor

@wiseman
Thanks for reporting this!
Could you please mention which perun version are you using?

@allentiak allentiak changed the title images-resize task moves images 'images-resize' task moves images May 14, 2019
@wiseman
Copy link
Contributor Author

wiseman commented May 15, 2019

I'm using 0.4.3-SNAPSHOT.

@allentiak
Copy link
Contributor

allentiak commented May 15, 2019 via email

@wiseman
Copy link
Contributor Author

wiseman commented May 15, 2019

0.4.2-SNAPSHOT:
It almost works. It seems like it's trying to keep resized images with the original images, but unfortunately there's an extra level of public in the output path.

target/public/2019-05-01-figuring-out-whats-overhead
target/public/2019-05-01-figuring-out-whats-overhead/3ff1.png
target/public/public/2019-05-01-figuring-out-whats-overhead/3ff2_800.png

Versions older than 0.4.2-SNAPSHOT give the same behavior as 0.4.2-SNAPSHOT.

@allentiak
Copy link
Contributor

allentiak commented May 15, 2019 via email

@allentiak
Copy link
Contributor

I have edited my previous comment. Please check it again.

@wiseman
Copy link
Contributor Author

wiseman commented May 15, 2019

Yes. 0.4.3-SNAPSHOT has the behavior I Initially described, putting all resized images in public.

The behavior of versions 0.4.2-SNAPSHOT, 0.4.1-SNAPSHOT, 0.4.0-SNAPSHOT, and 0.3.0 is as I described here, putting resized images in a location that mirrors the location of the original image, except with an extra, erroneous level of public.

@allentiak
Copy link
Contributor

Thanks for your confirmation! I will take a look at this during the following days and let you know.

@allentiak allentiak self-assigned this May 15, 2019
wiseman added a commit to wiseman/perun that referenced this issue May 23, 2019
I think this makes `images-resize`'s behavior more consistent with
other tasks.

Fixes hashobject#233.
@allentiak allentiak assigned allentiak and unassigned allentiak Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants