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

g-image not crop #432

Open
danieldocki opened this issue May 15, 2019 · 2 comments
Open

g-image not crop #432

danieldocki opened this issue May 15, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@danieldocki
Copy link

Description

I do not know why but it seems that g-image is not working properly, it does not put the image at the optimal size and with that it is downloading an image with more than 4mb.

Screen Shot 2019-05-15 at 14 48 07

Environment

package.json

{
  "name": website-gridsome",
  "private": true,
  "scripts": {
    "build": "gridsome build",
    "develop": "gridsome develop",
    "explore": "gridsome explore"
  },
  "dependencies": {
    "@gridsome/plugin-sitemap": "^0.1.1",
    "@gridsome/source-filesystem": "^0.4.1",
    "@gridsome/transformer-remark": "^0.3.1",
    "gridsome": "^0.6.1",
    "gridsome-plugin-gtm": "^0.1.1",
    "gridsome-plugin-netlify-cms": "^1.0.6",
    "gridsome-plugin-remark-youtube": "^1.0.1",
    "marked": "^0.6.2",
    "netlify-cms": "^2.9.1",
    "vue2-touch-events": "^2.0.0"
  },
  "devDependencies": {
    "eslint": "^5.16.0",
    "eslint-plugin-gridsome": "^1.1.1",
    "eslint-plugin-vue": "^5.2.2",
    "vue-eslint-parser": "^6.0.4",
    "vue-svg-loader": "^0.12.0"
  }
}
<template>
  <Layout>
    <section class="container">
      <article
        v-for="block in $page.expertise.blocks"
        class="article -is-block"
      >
        <g-image
          :src="block.picture.imageUrl"
          :alt="block.picture.imageAlt"
          width="500"
          height="500"
          fit="cover"
          class="image"
        />

        <div class="about">
          <h2 class="title">
            {{ block.title }}
          </h2>
          <p class="description">
            {{ block.description }}
          </p>
        </div>
      </article>
    </section>
  </Layout>
</template>

<page-query>
query Page($path: String!) {
  expertise: expertise(path: $path) {
    title
    description
    blocks {
      title
      description
      picture {
        imageUrl(width: 500, quality: 80)
        imageAlt
      }
    }
    seo {
      title
      description
    }
  }
}
</page-query>

For Tooling issues:

  • Node version: v10.8.0
  • Platform: Mac
@hjvedvik
Copy link
Member

What does your frontmatter section with the imageUrl field look like?

@robaxelsen robaxelsen added the bug Something isn't working label May 16, 2019
@danieldocki
Copy link
Author

@hjvedvik

I think you want to see this.

---
title: Procedimentos restauradores
description: >-
  Os procedimentos...
blocks:
  - title: Restauração em cerâmica ou porcelana
    description: >-
      Muito utilizada.... 
    picture:
      imageAlt: Restauração em cerâmica ou porcelana
      imageUrl: /uploads/restauracao-em-ceramica-ou-porcelana.png
  - title: Restauração em resina composta em dentes anteriores
    description: >-
      Os dentes anteriores... 
    picture:
      imageAlt: resina-composta-dente-anterior
      imageUrl: /uploads/img_5582a.jpg
seo:
  title: 'Procedimentos restauradores '
  description: >-
    Os procedimentos...
---

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants