Giter VIP home page Giter VIP logo

Comments (3)

qhenkart avatar qhenkart commented on June 19, 2024 1

@ramonfritsch Thank you so much for your expedient response and resolution. The PluginError was fixed but unfortunately it caused a new problem to arise. I wasn't sure if I should file a new issue or just comment on this one. Upon running Gulp Unretina, I now get this error:

events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: write EPIPE
    at exports._errnoException (util.js:746:11)
    at WriteWrap.afterWrite (net.js:775:14)

I didn't write the gulp file, and the person who did is no longer working here. Strangely enough, we haven't had a problem running our gulp file exactly how it's written until yesterday.

I'm including the Gulp tasks that run unretina, both of which cause the same error independently.

gulp.task('sprites-unretina', ['sprites-clean'], function() {
        var tasks = util.getFolders(inputPath).map(function(folder) {
            return gulp.src(inputPath + folder + '/*2x*')
                .pipe(rename(function(filePath) {
                    filePath.basename = filePath.basename.replace(/(\-|\@)?2x/i, '');
                }))
                .pipe(unretina())
                .pipe(gulp.dest(inputPath + folder + '/1x/'));
        });

        return merge(tasks);
    });
 gulp.task('images-unretina', ['images-clean'], function() {
        var tasks = util.getFolders(inputPath).map(function(folder) {
            var imageData = {};

            return gulp.src(inputPath + folder + '/*2x*.@(png|jpg)')
                // create 2x urls for scss
                .pipe(foreach(function(stream, file) {
                    var imageName = path.basename(file.path, path.extname(file.path)).replace(/(\-|\@)?2x/i, '');

                    imageData[imageName] = {};
                    imageData[imageName].url2x = '#{$assets_path}/' + inputPath + folder + '/' + path.basename(file.path);

                    return stream;
                }))

                .pipe(rename(function(filePath) {
                    filePath.basename = filePath.basename.replace(/(\-|\@)?2x/i, '');
                }))
                .pipe(unretina())

                // create 1x urls for scss
                .pipe(foreach(function(stream, file) {
                    var imageName = path.basename(file.path, path.extname(file.path));

                    imageData[imageName].url = '#{$assets_path}/' + inputPath + folder + '/1x/' + path.basename(file.path);

                    return stream;
                }))

                .pipe(gulp.dest(outputPath + '/' + folder + '/1x'))
                .on('end', function() {
                    fs.writeFileSync(paths.scss + '/' + folder + '/_images.scss', template({items: imageData}));
                });
        });

        return merge(tasks);
    })

from gulp-unretina.

ramonfritsch avatar ramonfritsch commented on June 19, 2024

Hi there,

I just committed a fix for that. Have a look.
Also, it's firing because you're trying to use a stream as the input. It only works with files.

from gulp-unretina.

ramonfritsch avatar ramonfritsch commented on June 19, 2024

Hi there,

Never had this problem before. I did a quick test yesterday and everything
is running fine now.

Make sure you have imagemagick installed, that may be the cause.

On Thu, Sep 17, 2015 at 10:18 AM, Quest Henkart [email protected]
wrote:

@ramonfritsch https://github.com/ramonfritsch Thank you so much for
your expedient response and resolution. The PluginError was fixed but
unfortunately it caused a new problem to arise. I wasn't sure if I should
file a new issue or just comment on this one. Upon running Gulp Unretina, I
now get this error:

events.js:85
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at exports._errnoException (util.js:746:11)
at WriteWrap.afterWrite (net.js:775:14)

I didn't write the gulp file, and the person who did is no longer working
here. Strangely enough, we haven't had a problem running our gulp file
exactly how it's written until yesterday.

I'm including the Gulp tasks that run unretina, both of which cause the
same error independently.

gulp.task('sprites-unretina', ['sprites-clean'], function() {
var tasks = util.getFolders(inputPath).map(function(folder) {
return gulp.src(inputPath + folder + '/2x')
.pipe(rename(function(filePath) {
filePath.basename = filePath.basename.replace(/(-|@)?2x/i, '');
}))
.pipe(unretina())
.pipe(gulp.dest(inputPath + folder + '/1x/'));
});

    return merge(tasks);
});

gulp.task('images-unretina', ['images-clean'], function() {
var tasks = util.getFolders(inputPath).map(function(folder) {
var imageData = {};

        return gulp.src(inputPath + folder + '/*2x*.@(png|jpg)')
            // create 2x urls for scss
            .pipe(foreach(function(stream, file) {
                var imageName = path.basename(file.path, path.extname(file.path)).replace(/(\-|\@)?2x/i, '');

                imageData[imageName] = {};
                imageData[imageName].url2x = '#{$assets_path}/' + inputPath + folder + '/' + path.basename(file.path);

                return stream;
            }))

            .pipe(rename(function(filePath) {
                filePath.basename = filePath.basename.replace(/(\-|\@)?2x/i, '');
            }))
            .pipe(unretina())

            // create 1x urls for scss
            .pipe(foreach(function(stream, file) {
                var imageName = path.basename(file.path, path.extname(file.path));

                imageData[imageName].url = '#{$assets_path}/' + inputPath + folder + '/1x/' + path.basename(file.path);

                return stream;
            }))

            .pipe(gulp.dest(outputPath + '/' + folder + '/1x'))
            .on('end', function() {
                fs.writeFileSync(paths.scss + '/' + folder + '/_images.scss', template({items: imageData}));
            });
    });

    return merge(tasks);
})


Reply to this email directly or view it on GitHub
#1 (comment)
.

from gulp-unretina.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.