Coder Social home page Coder Social logo

Comments (8)

yuyang2009 avatar yuyang2009 commented on May 21, 2024 4

Thanks @lepture , I have seen the code. It seems they are in the same size. There may be something wrong with the "numpy". The images become random size when I transform them to "ndarry".
img

from captcha.

lepture avatar lepture commented on May 21, 2024

They are in the same size. https://github.com/lepture/captcha/blob/master/captcha/image.py#L103

from captcha.

ypwhs avatar ypwhs commented on May 21, 2024

I have the same question.

It is not always in the same size. @lepture

from captcha.

lepture avatar lepture commented on May 21, 2024

@ypwhs Can you create a test case to reproduce it?

from captcha.

ypwhs avatar ypwhs commented on May 21, 2024
from captcha.image import ImageCaptcha
import random

generator = ImageCaptcha(width=160, height=60)
for i in range(1000):
    random_num = str(random.randint(1000, 9999))
    img = generator.generate_image(random_num)
    if img.size != (160, 60):
        print img.size

snip20170218_6

from captcha.

jinji-hanbin avatar jinji-hanbin commented on May 21, 2024

@ypwhs 解决了吗?这个验证码大小问题

from captcha.

eromoe avatar eromoe commented on May 21, 2024

Due to this captcha.image line 200: width = max(text_width, self._width)
I have made a pull request #17

from captcha.

lepture avatar lepture commented on May 21, 2024

@eromoe 0.2.3 is released.

from captcha.

Related Issues (20)

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.